Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Error when building with webpack on Windows. #544

Closed
6 of 7 tasks
lini opened this issue May 30, 2018 · 9 comments
Closed
6 of 7 tasks

Error when building with webpack on Windows. #544

lini opened this issue May 30, 2018 · 9 comments

Comments

@lini
Copy link

lini commented May 30, 2018

  • You are submitting: a bug report.

Tell us about the problem

Webpack build fails on Windows when using the @next version and updated dependencies.
Running tns build android --bundle --env.uglify results in multiple errors:

ERROR in ./calendar/view-modes/view-modes-page.xml
Module not found: Error: Can't resolve 'C:UsersstratevDocumentsGitHub
ativescript-ui-calendardemoapp
avigationexample-page.js' in 'C:\Users\stratev\Documents\GitHub\nativescript-ui-calendar\demo\app\calendar\view-modes'
 @ ./calendar/view-modes/view-modes-page.xml 1:69-174 1:260-365
 @ . sync (root|page)\.(xml|css|js|ts|scss)$
 @ ../node_modules/nativescript-dev-webpack/register-modules.js
 @ ./app.ts
Unable to apply changes on device: xxxxx. Error is: Executing webpack failed with exit code 2..

No such errors when building on Linux (Ubuntu).

Local environment

  • Platform Windows
  • Node version 8.9.1
  • NativeScript CLI version 4.0.2

Project data

  • Platform you are building the app for iOS
  • Node dependencies:
"nativescript": {
    "id": "org.nativescript.demo",
    "tns-ios": {
      "version": "next"
    },
    "tns-android": {
      "version": "4.2.0-2018-05-29-02"
    }
  },
  "dependencies": {
    "nativescript-theme-core": "^1.0.4",
    "nativescript-ui-calendar": "../src",
    "nativescript-unit-test-runner": "^0.3.4",
    "tns-core-modules": "next"
  },
  "devDependencies": {
    "awesome-typescript-loader": "~3.1.3",
    "babel-traverse": "6.26.0",
    "babel-types": "6.26.0",
    "babylon": "6.18.0",
    "clean-webpack-plugin": "~0.1.19",
    "copy-webpack-plugin": "~4.5.1",
    "css-loader": "~0.28.7",
    "extract-text-webpack-plugin": "~3.0.2",
    "filewalker": "0.1.2",
    "jasmine-core": "^2.5.2",
    "karma": "^1.3.0",
    "karma-jasmine": "^1.0.2",
    "karma-nativescript-launcher": "^0.4.0",
    "lazy": "1.0.11",
    "nativescript-css-loader": "~0.26.0",
    "nativescript-dev-typescript": "^0.6.0",
    "nativescript-dev-webpack": "next",
    "nativescript-worker-loader": "~0.8.1",
    "raw-loader": "~0.5.1",
    "resolve-url-loader": "~2.3.0",
    "tns-platform-declarations": "~4.0.0",
    "tslint": "~5.4.3",
    "typescript": "~2.7.2",
    "uglifyjs-webpack-plugin": "~1.2.5",
    "webpack": "~4.5.0",
    "webpack-bundle-analyzer": "^2.9.1",
    "webpack-cli": "~2.0.14",
    "webpack-sources": "~1.0.1"
  },
  • Webpack configuration:
default config
@gore1
Copy link

gore1 commented Jun 5, 2018

Confirmed.
I have same issue after updating to webpack 0.12 following blogpost: https://www.nativescript.org/blog/upgrading-to-nativescript-webpack-0.12.0

On Windows the backslashes seem to get lost.

@NickIliev
Copy link
Contributor

@sis0k0 let me know if you need application/environment to reproduce this issue.

@mgambati
Copy link

What workaround is possible to fix paths in Windows?

@sis0k0
Copy link
Contributor

sis0k0 commented Jun 12, 2018

@mgambati, try running tns run android first and then tns run android --bundle.

@RoyiNamir
Copy link

@sis0k0 Can we add to that uglify & aot ?

@mgambati
Copy link

@sis0k0 Actually, I only can run tns run Android. tns run android --bundle crashes the app when starting.
I really need to bundle with Webpack, my build depends on some Webpack plugins.

@RoyiNamir
Copy link

Same here . --bundle crashes. ( windows machine)
This prevents us from upgrading....
@sis0k0 is there any hotfix version webpackdev@? than we can apply a fix ?

@NickIliev NickIliev added this to the 0.12.1 milestone Jun 13, 2018
@NickIliev
Copy link
Contributor

Caused by #558

@gore1
Copy link

gore1 commented Jun 13, 2018

@mgambati problem is with fragments.
Workaround: I refactored my app by removing all fragments out of xml and replacing with builder.load({ path: 'shared', name: 'actionbar' }); in the js files.

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

No branches or pull requests

6 participants