-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught ReferenceError: process is not defined in Logger #149
Comments
Apparently I fixed the issue by adding
|
Interesting. I dont think Ive ever encountered a situation when process.env wasnt available. Especially with webpack. In any case, Its a good idea for me to add protection against it not being there so I will do that shortly. I do wonder though, if you build your app for production, wouldnt it make thanks |
I don't have process.env available at runtime. I declare some variables as build args on process.env at build time ( And if you wonder then why isn't it working the same for process.env.DEBUG the answer is - because I exclude node_modules from being compiled by webpack. I think it would be a better approach to check for the existence of process.env to avoid these type of errors, also thank you for the fast reply. |
Still curious. This is React's index.js: if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react.production.min.js');
} else {
module.exports = require('./cjs/react.development.js');
} I wonder how it works and Uploady's check doesnt. |
I am not compiling Uploady with webpack so any process.env variable that I inject into my code won't be available there because webpack is not even parsing those files. Maybe passing a props with DEBUG_MODE to the component might be a better idea or even any different approach where we can explicitly specify these configs. |
Wouldnt that be the same for React though? Uploady accepts a |
@cristianbuta version 0.11.1 is out with a fix. |
This still seems to be an issue |
@dbousamra ill need more information. Please open a new issue with all the details/repro you can provide |
Basically for me the issue is occurring because I am running in an environment where Why is process not defined in my environement - well I am still digging into it. It seems to be related to some changes vite has made with production bundling. |
Describe the bug
Using the Custom Upload Button (asUploadButton) implementation from the provided example throws the following error in console: Uncaught ReferenceError: process is not defined
To Reproduce
Steps to reproduce the behavior:
Expected behavior
There should be no error.
Versions
"@rpldy/upload-button": "^0.10.0",
"@rpldy/uploady": "^0.10.0",
Ubuntu 18
Google Chrome
Code
The text was updated successfully, but these errors were encountered: