Registry Mirror
Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.
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

Description

@lini
  • 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

Activity

  1. self-assigned this
    on May 30, 2018
  2. gore1 commented on Jun 5, 2018

    @gore1

    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.

  3. NickIliev commented on Jun 8, 2018

    @NickIliev

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

  4. mgambati commented on Jun 12, 2018

    @mgambati

    What workaround is possible to fix paths in Windows?

  5. sis0k0 commented on Jun 12, 2018

    @sis0k0
    Contributor

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

  6. mid787 commented on Jun 12, 2018

    @mid787

    @sis0k0 Can we add to that uglify & aot ?

  7. mgambati commented on Jun 12, 2018

    @mgambati

    @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.

  8. mid787 commented on Jun 13, 2018

    @mid787

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

  9. added this to the milestone on Jun 13, 2018
  10. NickIliev commented on Jun 13, 2018

    @NickIliev

    Caused by #558

  11. gore1 commented on Jun 13, 2018

    @gore1

    @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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions