0

I'm trying to create a template with OnsenUI 2 and I can't load the CSS files from the node_modules folder in the .angular-cli.json file. I did this as indicated on https://onsen.io/v2/guide/angular2/#angular-2

"styles": [
          "../node_modules/onsenui/css/onsenui.css",
          "../node_modules/onsenui/css/onsen-css-components.css",
          "styles.css"
        ],

I just checked the CSS files and they do exist in this folder CSS files in project

Then I see this error

ERROR in ./node_modules/css-loader?{"sourceMap":false,"import":false}!./node_modules/postcss-loader/lib?{"ident":"postcss","sourceMap":false}!./node_modules/onsenui/css/onsenui.css Module build failed: Error: Can't resolve 'ionicons/css/ionicons.min.css' in 'C:\Users\mauri\Documents\GitHub\IMS_MobileApps\Demos\Demos - OnsenUI\demo1\node_modules\onsenui\css' at onError (C:\Users\mauri\Documents\GitHub\IMS_MobileApps\Demos\Demos - OnsenUI\demo1\node_modules\enhanced-resolve\lib\Resolver.js:61:15) at loggingCallbackWrapper (C:\Users\mauri\Documents\GitHub\IMS_MobileApps\Demos\Demos - OnsenUI\demo1\node_modules\enhanced-resolve\lib\createInnerCallback.js:31:19) at runAfter (C:\Users\mauri\Documents\GitHub\IMS_MobileApps\Demos\Demos - OnsenUI\demo1\node_modules\enhanced-resolve\lib\Resolver.js:158:4) at innerCallback (C:\Users\mauri\Documents\GitHub\IMS_MobileApps\Demos\Demos - OnsenUI\demo1\node_modules\enhanced-resolve\lib\Resolver.js:146:3) at loggingCallbackWrapper (C:\Users\mauri\Documents\GitHub\IMS_MobileApps\Demos\Demos - OnsenUI\demo1\node_modules\enhanced-resolve\lib\createInnerCallback.js:31:19) at next (C:\Users\mauri\Documents\GitHub\IMS_MobileApps\Demos\Demos - OnsenUI\demo1\node_modules\tapable\lib\Tapable.js:252:11) at C:\Users\mauri\Documents\GitHub\IMS_MobileApps\Demos\Demos - OnsenUI\demo1\node_modules\enhanced-resolve\lib\UnsafeCachePlugin.js:40:4 at loggingCallbackWrapper (C:\Users\mauri\Documents\GitHub\IMS_MobileApps\Demos\Demos - OnsenUI\demo1\node_modules\enhanced-resolve\lib\createInnerCallback.js:31:19) at runAfter (C:\Users\mauri\Documents\GitHub\IMS_MobileApps\Demos\Demos - OnsenUI\demo1\node_modules\enhanced-resolve\lib\Resolver.js:158:4) at innerCallback (C:\Users\mauri\Documents\GitHub\IMS_MobileApps\Demos\Demos - OnsenUI\demo1\node_modules\enhanced-resolve\lib\Resolver.js:146:3) at loggingCallbackWrapper (C:\Users\mauri\Documents\GitHub\IMS_MobileApps\Demos\Demos - OnsenUI\demo1\node_modules\enhanced-resolve\lib\createInnerCallback.js:31:19) at next (C:\Users\mauri\Documents\GitHub\IMS_MobileApps\Demos\Demos - OnsenUI\demo1\node_modules\tapable\lib\Tapable.js:252:11) at innerCallback (C:\Users\mauri\Documents\GitHub\IMS_MobileApps\Demos\Demos - OnsenUI\demo1\node_modules\enhanced-resolve\lib\Resolver.js:144:11) at loggingCallbackWrapper (C:\Users\mauri\Documents\GitHub\IMS_MobileApps\Demos\Demos - OnsenUI\demo1\node_modules\enhanced-resolve\lib\createInnerCallback.js:31:19) at next (C:\Users\mauri\Documents\GitHub\IMS_MobileApps\Demos\Demos - OnsenUI\demo1\node_modules\tapable\lib\Tapable.js:249:35) at resolver.doResolve.createInnerCallback (C:\Users\mauri\Documents\GitHub\IMS_MobileApps\Demos\Demos - OnsenUI\demo1\node_modules\enhanced-resolve\lib\DescriptionFilePlugin.js:44:6) @ ./node_modules/onsenui/css/onsenui.css 4:14-119 @ multi ./node_modules/onsenui/css/onsenui.css ./node_modules/onsenui/css/onsen-css-components.css ./src/styles.css

Error in detail

1 Answer 1

0

I was using Angular CLI 1.6.6 and I updated it to 1.6.7 by running npm install -g @angular/cli@latest. This solved the issue

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.