Closed caferrari closed 5 years ago
I have same problem. Do you have any idea? Thanx
Look at the solution here: https://discourse.nativescript.org/t/nativescript-webpack-version-dont-load-platform-css/2294
The solution from https://github.com/NativeScript/template-master-detail-ng/pull/64 by @vakrilov worked for me.
PS: Make sure you install sass-loader:
"sass-loader": "^6.0.6"
UPDATE! With this solution, you're not able to run the app with livesync in regards to the
.scss
files on your components.
There's a chance of the pull request I made (#268) gets anybody else's problem fixed.
Worked for me. This has only to do with platform specific main sheets (app.ios.css
and app.android.css
).
Regarding the fact of being written in sass or less, I'd suggest to run via tns first (in order to generate all css files) and then run any npm script.
Bare in mind this plugin is mainly focused on production therefore imho changes like in NativeScript/template-master-detail-ng#64 seem to be creating more problems than actually fixing (if I'm not missing the point there).
I'm having the exact same problem as @caferrari and have no clue of what to do. Any help/suggestion would be appreciated.
I noticed that "tns build" compiles .scss to .css. "npm run build-android-bundle" doesn't do the scss compile and therefor gives the error. I thought sass-loader would compile the scss-files, is that right?
The repo https://github.com/sis0k0/nativescript-webpack-sass of @sis0k0 has all .css files in it, should I do that also?
@JohanBeumer I am having the same issue. You managed to solve it ?
@mozi22 have you updated to the latest nativescript-dev-webpack as described here. If so please post the content of your package.json and the versions you are using (NativeScript, Webpack, tns-core-modules, tns runtimes)
Hi @NickIliev, I somehow managed to pass that issue using your advice but I am still getting a problem saying Failed to find module: "nativescript-angular/platform", relative to: app/tns_modules/
could you please help me with this ?
Here's my package.json
.
{
"name": "angular-seed-advanced",
"version": "0.0.0",
"nativescript": {
"id": "com.maxtoolbox.vrsta",
"tns-android": {
"version": "3.3.0"
},
"tns-ios": {
"version": "3.3.0"
}
},
"scripts": {
"preinstall": "mkdirp app",
"clean": "rimraf platforms node_modules lib hooks app && mkdirp app",
"ns-bundle": "ns-bundle",
"publish-ios-bundle": "npm run ns-bundle --ios --publish-app",
"start-android-bundle": "npm run ns-bundle --android --run-app",
"start-ios-bundle": "npm run ns-bundle --ios --run-app",
"build-android-bundle": "npm run ns-bundle --android --build-app",
"build-ios-bundle": "npm run ns-bundle --ios --build-app"
},
"dependencies": {
"@angular/animations": "~5.0.0",
"@angular/common": "~5.0.0",
"@angular/compiler": "~5.0.0",
"@angular/core": "~5.0.0",
"@angular/forms": "~5.0.0",
"@angular/http": "~5.0.0",
"@angular/platform-browser": "~5.0.0",
"@angular/router": "~5.0.0",
"@ngrx/core": "^1.2.0",
"@ngrx/effects": "^2.0.3",
"@ngrx/store": "^2.2.2",
"@ngx-translate/core": "~7.0.0",
"@ngx-translate/http-loader": "~0.1.0",
"angulartics2": "^2.2.2",
"lodash": "^4.17.4",
"nativescript-angular": "^5.0.0",
"nativescript-background-http": "^3.1.0",
"nativescript-camera": "^3.1.4",
"nativescript-checkbox": "^3.0.1",
"nativescript-fingerprint-auth": "^5.0.0",
"nativescript-imagepicker": "^4.0.1",
"nativescript-iqkeyboardmanager": "^1.1.0",
"nativescript-localstorage": "^1.1.2",
"nativescript-mediafilepicker": "^1.0.4",
"nativescript-pdf-view": "^2.0.1",
"nativescript-plugin-firebase": "^4.2.1",
"nativescript-pro-ui": "^3.2.0",
"nativescript-purchase": "^1.0.5",
"nativescript-theme-core": "^1.0.4",
"nativescript-toast": "^1.4.6",
"nativescript-videoplayer": "^3.1.0",
"ngrx-store-freeze": "0.1.9",
"reflect-metadata": "^0.1.8",
"rxjs": "^5.5.0",
"tns-core-modules": "^3.3.0",
"zone.js": "^0.8.4",
"@angular/platform-browser-dynamic": "~5.0.0"
},
"devDependencies": {
"@angular/compiler-cli": "~4.0.0 || ~4.1.0",
"@ngrx/store-devtools": "~3.2.4",
"@ngtools/webpack": "~1.8.2",
"@types/jasmine": "2.5.41",
"@types/lodash": "4.14.63",
"babel-traverse": "6.11.4",
"babel-types": "6.11.1",
"babylon": "6.8.4",
"codelyzer": "^3.0.1",
"copy-webpack-plugin": "~4.0.1",
"css-loader": "~0.28.7",
"extract-text-webpack-plugin": "~3.0.0",
"fs-extra": "^0.30.0",
"glob": "^7.0.5",
"lazy": "1.0.11",
"nativescript-css-loader": "~0.26.0",
"nativescript-dev-android-snapshot": "^0.0.9",
"nativescript-dev-sass": "^1.1.1",
"nativescript-dev-webpack": "^0.9.0",
"nativescript-worker-loader": "~0.8.1",
"opener": "^1.4.1",
"raw-loader": "~0.5.1",
"resolve-url-loader": "~2.1.0",
"rimraf": "^2.5.3",
"sass-loader": "~6.0.6",
"tar.gz": "^1.0.5",
"tns-platform-declarations": "^3.0.1",
"tslint": "^5.2.0",
"typescript": "~2.4.2",
"webpack": "~3.8.1",
"webpack-bundle-analyzer": "^2.8.2",
"webpack-sources": "~1.0.1"
}
}
yes @jogboms it is being referenced in app.ts
but shouldn't it be like that ?
oh yeah. @mozi22 you mean main.ts
. Have you tried cleaning up your node_modules folder?
@jogboms I removed node_modules
and did a fresh npm install
but that didn't helped. As you can see in my directory structure. It's app.ts
.
There are somethings wrong with some files i can see. You don't seem to be following the official app directory structure. Where did you get vendor.platform.js.android
?
I am using angular-seed-advanced for the development.
The file you mentioned is generated when I am running the following command from root.
npm run nativescript-install && gulp build.tns && concurrently --kill-others \"gulp build.tns.watch\" \"cd nativescript && tns debug android --emulator\"
At this point, I don't think I'd be able to help. Seeing the seed library hasn't been following the recent upgrades, i can't say for sure what could be causing this particular issue. I'd advice you create a fresh issue stating the exact new problem either in nativescript-angular or in the seed repo.
thanks @jogboms, I'll do that.
Hey Guys,
Thank you for the collaboration on these problems.
Let me close this issue as a stale one. Please open a new one if experience a problem with recent versions of NativeScript.
Output:
webpack.config.js:
package.json