-
-
Notifications
You must be signed in to change notification settings - Fork 40
After upgrading to tns 3.4.0 , nativescript-dev-webpack 0.9.0 and bundling with --env.aot Can't resolve *.*.css.shim.ngstyle #376
Comments
actually that doesnt look like a plugin. my bad. please post the |
Thanks @SamuelReeder for looking into it, I already have moduleId in component , here you go @component({ |
hmm its not the issue I thought it was. Im not quite sure whats happening |
Tested with sample grocery app https://github.com/NativeScript/sample-Groceries Received similar error when run tns build android --bundle --env.aot so it appears that problem is with not my project but in general when building with aot option |
I just used the cli (3.4.0) to create a brand new project, installed the webpack and ran the build, it said: 'Can't resolve './tabs.component.css''. I checked the webpack.config.js. // tns-core-modules reads the app.css and its imports using css-loader
{ test: /\/app\.css$/, use: "css-loader?url=false" },
{ test: /\/app\.scss$/, use: ["css-loader?url=false", "sass-loader"] },
// Angular components reference css files and their imports using raw-loader
{ test: /\.css$/, exclude: /\/app\.css$/, use: "raw-loader" },
{ test: /\.scss$/, exclude: /\/app\.scss$/, use: ["raw-loader", "resolve-url-loader", "sass-loader"] }, The actual file we have:
How to change the config to make it work? |
I have the same issue |
@NickIliev , can you please look into this as well. it appears --env.aot is not working as it should be. I am using windows 10 so it could be that it is related to only windows |
Same here. Every css file generates an error like |
@opennewsdev @skhye05 could you try if changing |
@jogboms Even if I tried with either I use Windows 10, too, like others. |
Okay @Beawolf then I think it'll be good to keep track of this issue seeing it's been labeled as a bug. |
@Beawolf @jogboms @milansar @Burgov @skhye05 @opennewsdev @SamuelReeder confirming this one as a bug reproducible only on Windows. Stay tuned for updates (the info will be updated here) |
@opennewsdev The current versions of the starter templates are not fully compatible with webpack. Check out this PR - https://github.com/NativeScript/template-tab-navigation-ng/pull/51 . Basically, you must update your dependencies and change your components to directly reference the .scss files. You can also create a new project from the branch like this:
|
@NickIliev - yes, windows only. |
I have the same issue. I upgraded with the migration guide and it works fine with I'm running onWindows 10. Also I use sass (indented syntax, not scss!). |
Happens here also : win 10 after upgrade to latest . @berchik BTW how do you handle AOT bundles for modules ? there are many common (http.js) files for example. I've heard that if a module is lazy loaded then it can not remove those libraries. Is it true ? |
I'm experincing this issue as well. Running Windows 10 |
This bug is confirmed from windows 10 also:
Errors:
|
Same problem. Windows 8.1 here. |
Having the same issue in Ubuntu 18.04... |
I updated my existing project to NativeScript 3.4.0 and followed all instructions given on
https://www.nativescript.org/blog/nativescript-webpack-0.9.0-what-changed-and-how-to-upgrade
When I prepare build using bundle and AOT, webpack gives following error for all components in my project. sample error for one component
ERROR in ./components/add-new-card/add-new-card.component.ngfactory.js
Module not found: Error: Can't resolve './add-new-card.component.css.shim.ngstyle' in 'G:\xxxx\xxxxx\xxxx\app\components\add-new-card'
@ ./components/add-new-card/add-new-card.component.ngfactory.js 9:9-61
@ ./app.module.ngfactory.js
@ ./main.aot.ts
Bundle without AOT works fine. Prior to upgrade, AOT build worked fine using ns-bundle command
Not sure what is problem
The text was updated successfully, but these errors were encountered: