-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
Mirgation Issue: 6.5 > 8.5 | Launch fails: 'env' not defined #1772
Comments
Hi @devingrayt6 see this, pinned on core repo: |
@NathanWalker unfortunately this solution did not work for me. Could there potentially be other dependencies causing this issue? |
Does it work if you run with |
It does not |
Hi @devingrayt6 when get a chance, could you include your |
Also experiencing this. I did try adding "qs": "npm:querystring@^0.2.1" with no success.
my webpack config:
package-lock.json: |
For me, the line that it's blowing up on in node_modules/util/util.js:110:27 is if I console.log(process); right before that line I get that process is undefined. |
In my case I comment this block on node_modules/util/util.js:109: |
We have the same solution pinned over here: |
We can probably just ensure env is defined on process when a .env file is not present in next webpack patch. |
I'm hitting this same error, but none of the suggestions here or in NativeScript/NativeScript#10329 (comment) make a difference. If I remove the lines @FlavioShift3 commented out, then I get the same error but elsewhere. Based on @NathanWalker 's comment above I created a .env file, but that made no difference either. Like @jeffswitzer found, process itself is undefined. To be specific, when I include the patch from the referenced issue, I received this error:
where the identified line is:
So it appears process is still undefined. Upon looking further, it sure feels like this note in Configuring Webpack is pertinent:
|
@dlcole - I had gotten around this in some hacky way via webpack config. Trying to remember, it was something like
I remember that it was by searching in the nativescript discord channel, that I found some tips. |
@jeffswitzer - Thanks!! I tried a few things, and this addition to
I'm not sure why this works or if it's even a good thing, but I'll run with it for now. |
Environment
Provide version numbers for the following components (information can be retrieved by running
tns info
in your project folder or by inspecting thepackage.json
of the project):Describe the bug
The project builds successfully, but crashes on launch with this error:
"An uncaught Exception occurred on "main" thread.
Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function
TypeError: Cannot read properties of undefined (reading 'env')
File: (file: app/webpack:/com.app.game/webpack/bootstrap:27:0)"
StackTrace:
./node_modules/util/util.js(file: app/webpack:/com.app.game/node_modules/util/util.js:109:11)
at webpack_require(file: app/webpack:/com.app.game/webpack/bootstrap:24:0)
at fn(file: app/webpack:/com.app.game/webpack/runtime/hot module replacement:62:0)
at ./node_modules/console-browserify/index.js(file: app/webpack:/com.app.game/node_modules/console-browserify/index.js:2:11)
at webpack_require(file: app/webpack:/com.app.game/webpack/bootstrap:24:0)
at fn(file: app/webpack:/com.app.game/webpack/runtime/hot module replacement:62:0)
at ./node_modules/@nativescript/core/data/observable/index.js(file:///data/data/com.app.game/files/app/vendor.js:6780:41)
at webpack_require(file: app/webpack:/com.app.game/webpack/bootstrap:24:0)
at fn(file: app/webpack:/com.app.game/webpack/runtime/hot module replacement:62:0)
at ./node_modules/@nativescript/core/globals/index.js(file:///data/data/com.app.game/files/app/vendor.js:10525:74)
at webpack_require(file: app/webpack:/com.app.game/webpack/bootstrap:24:0)
at webpack_exec(file:///data/data/com.app.game/files/app/bundle.js:29616:39)
at (file:///data/data/com.app.game/files/app/bundle.js:29617:71)
at webpack_require.X(file: app/webpack:/com.app.game/webpack/runtime/startup entrypoint:6:0)
at (file:///data/data/com.app.game/files/app/bundle.js:29617:47)
at (file:///data/data/com.app.game/files/app/bundle.js:29622:3)
at require(:1:266)
Package.json
WebPack
Additional context
The text was updated successfully, but these errors were encountered: