Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Webpack error #128

Open
artemave opened this issue Aug 28, 2021 · 2 comments
Open

Webpack error #128

artemave opened this issue Aug 28, 2021 · 2 comments

Comments

@artemave
Copy link

% ns prepare ios --release
Error while loading nativescript-cloud is: Default commands should be required before child commands
Preparing project...
assets by status 1.71 MiB [cached] 8 assets
Entrypoint bundle = runtime.js vendor.js bundle.js
Entrypoint tns_modules/inspector_modules = runtime.js vendor.js tns_modules/inspector_modules.js
orphan modules 764 KiB [orphan] 120 modules
runtime modules 2.71 KiB 8 modules
modules by path ./node_modules/ 2.94 MiB
  javascript modules 2.67 MiB 218 modules
  json modules 273 KiB
    modules by path ./node_modules/mdn-data/css/*.json 242 KiB 3 modules
    modules by path ./node_modules/css-tree/ 30.7 KiB
      ./node_modules/css-tree/package.json 1.65 KiB [built] [code generated]
      ./node_modules/css-tree/data/patch.json 29 KiB [built] [code generated]
modules by path ./app/ 117 KiB
  optional modules 22 KiB [optional]
    modules by path ./app/views/ 19.1 KiB 18 modules
    modules by path ./app/*.ts 2.76 KiB 4 modules
    ./app/app-root.xml 182 bytes [optional] [built] [code generated]
external "~/package.json" 42 bytes [optional] [built] [code generated]

ERROR in ./node_modules/@nota/nativescript-webview-ext/webview-ext.ios.js + 2 modules
Cannot get final name for export '__esModule' of ./node_modules/@nota/nativescript-webview-ext/webview-ext.ios.js
while generating the root export '__esModule' (used name: '__esModule')
Error: Cannot get final name for export '__esModule' of ./node_modules/@nota/nativescript-webview-ext/webview-ext.ios.js
while generating the root export '__esModule' (used name: '__esModule')
    at getFinalBinding (/Users/artem/projects/firetab/node_modules/webpack/lib/optimize/ConcatenatedModule.js:467:10)
    at getFinalName (/Users/artem/projects/firetab/node_modules/webpack/lib/optimize/ConcatenatedModule.js:523:18)
    at /Users/artem/projects/firetab/node_modules/webpack/lib/optimize/ConcatenatedModule.js:1387:24
    at ConcatenatedModule.codeGeneration (/Users/artem/projects/firetab/node_modules/webpack/lib/optimize/ConcatenatedModule.js:1435:7)
    at /Users/artem/projects/firetab/node_modules/webpack/lib/Compilation.js:2732:22
    at /Users/artem/projects/firetab/node_modules/webpack/lib/Cache.js:93:5
    at Hook.eval [as callAsync] (eval at create (/Users/artem/projects/firetab/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Cache.get (/Users/artem/projects/firetab/node_modules/webpack/lib/Cache.js:75:18)
    at ItemCacheFacade.get (/Users/artem/projects/firetab/node_modules/webpack/lib/CacheFacade.js:117:15)
    at Compilation._codeGenerationModule (/Users/artem/projects/firetab/node_modules/webpack/lib/Compilation.js:2725:9)
    at /Users/artem/projects/firetab/node_modules/webpack/lib/Compilation.js:2651:10
    at arrayIterator (/Users/artem/projects/firetab/node_modules/neo-async/async.js:3467:9)
    at processTicksAndRejections (node:internal/process/task_queues:78:11)

webpack 5.50.0 compiled with 1 error in 14320 ms
Executing webpack failed with exit code 1.

Which platform(s) does your issue occur on?

  • iOS
  • emulator

Please, provide the following version numbers that your issue occurs with:

  • CLI: (run tns --version to fetch it)

8.0.2

  • iOS: XCode version.

12.3

  • nodejs: (run node --version to fetch it)

v16.5.0

  • tns-core-modules: (run npm ls tns-core-modules in your project to fetch it.)
[] % npm ls tns-core-modules
firetab@ /Users/artem/projects/firetab
└── (empty)
  • Runtime(s): (look for the "tns-android" and "tns-ios" properties in the package.json file of your project)

None

  • Plugin(s): (look for the version numbers in the package.json file of your
    project and paste your dependencies and devDependencies here)
  "dependencies": {
    "@nativescript/core": "~8.0.0",
    "@nativescript/firebase": "^11.1.3",
    "@nativescript/theme": "^3.0.1",
    "@nota/nativescript-webview-ext": "^8.0.0",
    "nativescript-insomnia": "^2.0.0",
    "nativescript-ui-listview": "~10.0.0"
  },
  "devDependencies": {
    "@nativescript/ios": "8.0.0",
    "@nativescript/webpack": "~5.0.0-beta.0",
    "@types/node": "^16.7.1",
    "@typescript-eslint/eslint-plugin": "^4.29.3",
    "@typescript-eslint/parser": "^4.29.3",
    "donc": "^1.4.0",
    "eslint": "^7.32.0",
    "ts-node": "^10.2.1",
    "typescript": "~4.3.5"
  },

From webpack is actually latest beta. From package-lock.json:

    "node_modules/@nativescript/webpack": {
      "version": "5.0.0-rc.4",

Please, tell us how to recreate the issue in as much detail as possible.

ns prepare ios --release
@brandonros
Copy link

Did you ever find a fix?

@brandonros
Copy link

I fixed it with this in webpack.config.js:

const webpack = require('@nativescript/webpack')

module.exports = (env) => {
  webpack.init(env)
  webpack.mergeWebpack(env => {
    return {
      optimization: {
        concatenateModules: false
      }
     }
  })
  return webpack.resolveConfig()
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants