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

Module not found when adding lazy loading #44

Closed
ignaciolarranaga opened this issue Dec 27, 2016 · 2 comments
Closed

Module not found when adding lazy loading #44

ignaciolarranaga opened this issue Dec 27, 2016 · 2 comments

Comments

@ignaciolarranaga
Copy link

I made several changes to a repo that was working correctly with webpack (I'm creating and app from scratch to try to reproduce a webpack issue I had with another app) and then started to fail the start-ios-bundle / start-android-bundle.

Basically I was adding lazy loaded modules (first module loaded eagerly and the second will be loaded lazy). There are 2 modules RegistrationModule and MainModule, RegistrationModule load eagerly, and later MainModule load lazy.
Without the server the second module will actually not load (the app will just display a warning dialog), but once I made the changes to the app they started failing.

The app works correctly running without webpack (warning dialog appear) but I can not start the webpack bundle, either on ios/android the error is the same:

ERROR in ./main.aot.ts
Module not found: Error: Can't resolve './app.module.ngfactory' in '/Users/ignacio/Workspaces/DuenoVende/hezea-app/app'
 @ ./main.aot.ts 2:0-60
Child app/pages/registration/registration.html:
       [0] ./pages/registration/registration.html 542 bytes {0} [built]
Child app/pages/main/main.html:
       [0] ./pages/main/main.html 307 bytes {0} [built]
Child app/pages/registration/registration-common.css:
       [0] ./pages/registration/registration-common.css 405 bytes {0} [built]
Child extract-text-webpack-plugin:
       [2] ../~/resolve-url-loader!../~/css-loader!../~/nativescript-dev-webpack/platform-css-loader.js!./app.css 885 bytes {0} [built] [1 warning]
        + 2 hidden modules
    
    WARNING in ../~/resolve-url-loader!../~/css-loader!../~/nativescript-dev-webpack/platform-css-loader.js!./app.css
      resolve-url-loader cannot operate: CSS error
      /Users/ignacio/Workspaces/DuenoVende/hezea-app/app/app.css:6:426: property missing ':'
      at error (/Users/ignacio/Workspaces/DuenoVende/hezea-app/node_modules/css/lib/parse/index.js:62:15)

npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "webpack-android"
npm ERR! node v6.9.2
npm ERR! npm  v4.0.3
npm ERR! code ELIFECYCLE
npm ERR! @ webpack-android: `webpack --config=webpack.android.js --progress`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the @ webpack-android script 'webpack --config=webpack.android.js --progress'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     webpack --config=webpack.android.js --progress
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs 
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls 
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/ignacio/Workspaces/DuenoVende/hezea-app/npm-debug.log

npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "start-android-bundle"
npm ERR! node v6.9.2
npm ERR! npm  v4.0.3
npm ERR! code ELIFECYCLE
npm ERR! @ prestart-android-bundle: `npm run webpack-android`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ prestart-android-bundle script 'npm run webpack-android'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run webpack-android
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs 
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls 
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/ignacio/Workspaces/DuenoVende/hezea-app/npm-debug.log

For reproduction I'm maintaining this repo: https://bitbucket.org/ignaciolarranaga/nativescript-webpack-problems.git please refer to tag problem-2 for the specific problem.
The history of commits shows the changes made, at problem-1-fixed tag the app actually works (problem-1 was actually not preventing the app to start).

@sis0k0
Copy link
Contributor

sis0k0 commented Dec 27, 2016

Hi, @ignaciolarranaga.
The problem seems to be the styleUrls property in the registration.component.ts. We're currently working on the problem. Refer to #36 issue.

@hdeshev
Copy link
Contributor

hdeshev commented Dec 27, 2016

Closing in favor of #36

@hdeshev hdeshev closed this as completed Dec 27, 2016
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

3 participants