Skip to content
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

TypeError: Cannot read properties of undefined (reading 'env') #10491

Open
kfathy-ys opened this issue Feb 13, 2024 · 0 comments
Open

TypeError: Cannot read properties of undefined (reading 'env') #10491

kfathy-ys opened this issue Feb 13, 2024 · 0 comments
Labels
bug-pending-triage Reported bug, pending triage to confirm.

Comments

@kfathy-ys
Copy link

Issue Description

after project build sussuce the project crashed and not start and return TypeError: Cannot read properties of undefined (reading 'env')
I didn't use process.env I just import environment and this webpack file
const webpack = require("@nativescript/webpack");

module.exports = (env) => {
webpack.init(env);

// Learn how to customize:
// https://docs.nativescript.org/webpack

return webpack.resolveConfig();
};

Reproduction

No response

Relevant log output (if applicable)

Runtime initialization took 162ms (version 8.6.3, V8 version 10.3.22)

CONSOLE LOG: Loading inspector modules...

CONSOLE LOG: Finished loading inspector modules.

***** Fatal JavaScript exception - application has been terminated. *****

NativeScript encountered a fatal error:



Error calling module function

TypeError: Cannot read properties of undefined (reading 'env')

File: (file:///app/vendor.js:171375:19)



StackTrace: 

./node_modules/util/util.js(file:///app/vendor.js:171375:20)

at __webpack_require__(file:///app/runtime.js:23:41)

at ./node_modules/object-inspect/util.inspect.js(file:///app/vendor.js:157295:18)

at __webpack_require__(file:///app/runtime.js:23:41)

at ./node_modules/object-inspect/index.js(file:///app/vendor.js:156831:19)

at __webpack_require__(file:///app/runtime.js:23:41)

at ./node_modules/side-channel/index.js(file:///app/vendor.js:168403:15)

at __webpack_require__(file:///app/runtime.js:23:41)

at ./node_modules/qs/lib/stringify.js(file:///app/vendor.js:158523:22)

at __webpack_require__(file:///app/runtime.js:23:41)

at ./node_modules/qs/lib/index.js(file:///app/vendor.js:158232:17)

at __webpack_require__(file:///app/runtime.js:23:41)

at ./node_modules/url/url.js(file:///app/vendor.js:170239:17)

at __webpack_require__(file:///app/runtime.js:23:41)

at ./node_modules/@nota/nativescript-webview-ext/webview-ext-common.js(file:///app/vendor.js:130656:61)

at __webpack_require__(file:///app/runtime.js:23:41)

at ./node_modules/@nota/nativescript-webview-ext/webview-ext.ios.js(file:///app/vendor.js:131548:77)

at __webpack_require__(file:///app/runtime.js:23:41)

at ./src/app/account/register/register.component.ts(file:///app/bundle.js:3094:88)

at __webpack_require__(file:///app/runtime.js:23:41)

at ./src/app/app-routing.module.ts(file:///app/bundle.js:4097:94)

at __webpack_require__(file:///app/runtime.js:23:41)

at ./src/app/app.module.ts(file:///app/bundle.js:4437:77)

at __webpack_require__(file:///app/runtime.js:23:41)

at ./src/main.ts(file:///app/bundle.js:33:73)

at __webpack_require__(file:///app/runtime.js:23:41)

at __webpack_exec__(file:///app/bundle.js:33584:39)

at (file:///app/bundle.js:33585:111)

at __webpack_require__.X(file:///app/runtime.js:102:21)

at (file:///app/bundle.js:33585:47)

at (file:///app/bundle.js:33590:3)

at require(:1:232)

Environment

OS: macOS 14.2.1

CPU: (4) x64 Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz

Shell: /bin/bash

node: 12.18.3

npm: 6.14.6

nativescript: 8.0.2

android

java: 1.8.0_282

ndk: Not Found

apis: 30

build_tools: 30.0.3

system_images:

  • android-30 | Google APIs Intel x86 Atom

ios

xcode: 15.1/15C65

cocoapods: 1.14.3

python: 3.9.6

python3: 3.9.6

ruby: 2.6.10

platforms:

  • DriverKit 23.2

  • iOS 17.2

  • macOS 14.2

  • tvOS 17.2

  • watchOS 10.2




### Dependencies



```json

"dependencies": {},

"devDependencies": {}

### Please accept these terms

- [X] I have searched the [existing issues](https://github.com/NativeScript/NativeScript/issues) as well as [StackOverflow](https://stackoverflow.com/questions/tagged/nativescript) and this has not been posted before
- [X] This is a bug report
- [X] I agree to follow this project's [Code of Conduct](https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#coc)
@kfathy-ys kfathy-ys added the bug-pending-triage Reported bug, pending triage to confirm. label Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-pending-triage Reported bug, pending triage to confirm.
Projects
None yet
Development

No branches or pull requests

1 participant