2

I upgraded the angular(2.1.2)and angular-cli version to latest, and I get the following error for each component I have:

ERROR in ./src/app/members/view-news/view-news.component.ts
Module not found: Error: Can't resolve 'view-news.component.css' in 'c:\xampp\htdocs\myapp\src\app\members\view-news'
 @ ./src/app/members/view-news/view-news.component.ts 74:21-55
 @ ./src/app/app.module.ts
 @ ./src/app/index.ts
 @ ./src/main.ts
 @ multi main

Although the file view-news.component.css exists in the same folder of the view-news.component.ts and worked in previous version. What's wrong?

3 Answers 3

6

did you try ./view-news.component.css as path?

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

Comments

0

Make sure you change the comments tag from <dom-element> to 'test.html' if you have it surrounding with test.html it will fail.

Comments

0

here is my Solution

In my case

path is like this "node_modules/jquery/dist/jquery.min.js",

i have corrected it by

"./node_modules/jquery/dist/jquery.min.js",

Actual Code

"styles": [
          "./node_modules/bootstrap/dist/css/bootstrap.min.css"
        ],
        "scripts": [
          "./node_modules/jquery/dist/jquery.min.js",
          "./node_modules/bootstrap/dist/js/bootstrap.min.js"
        ],

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.