Skip to content

Module not found: Error: Can't resolve './' #4883

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ellipizle opened this issue Feb 21, 2017 · 6 comments
Closed

Module not found: Error: Can't resolve './' #4883

ellipizle opened this issue Feb 21, 2017 · 6 comments

Comments

@ellipizle
Copy link

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Windows 8

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:
@angular/cli: 1.0.0-beta.32.3
node: 6.9.2
os: win32 x64

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

npm uninstall -g angular-cli @angular/cli
npm cache clean
npm install -g @angular/cli@latest
ng new sample
copied app folder from old-sample to new sample
ng serve

The log given by the failure.

Normally this include a stack trace and some more information.

ERROR in ./src/app/user/reset-password/reset.password.component.css
Module not found: Error: Can't resolve './' in 'C:\webweb\src\app\user
t\reset-password'
@ ./src/app/user/reset-password/reset.password.component.css 6:353-3
66
@ ./src/app/user/reset-password/reset-password.component.ts
@ ./src/app/user/index.ts
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts

ERROR in ./src/app/user/login/login.test.component.css
Module not found: Error: Can't resolve './' in 'C:\webweb\src\app\user\login'
@ ./src/app/user/login/login.test.component.css 6:363-376
@ ./src/app/usert/login/login.test.component.ts
@ ./src/app/user/index.ts
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts

ERROR in ./src/app/user/forgot-password/forgot-password.component.css

Module not found: Error: Can't resolve './' in 'C:\webweb\src\app\user\forgot-password'
@ ./src/app/user/forgot-password/forgot-password.component.css 6:353
-366
@ ./src/app/user/forgot-password/forgot-password.component.ts
@ ./src/app/user/index.ts
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi webpack-dev-server/client?http://localhost:4200/ ./src/main.ts

Mention any other details that might be useful.

this error started when i did upgrade angular/cli
i thought the errors could be as a result of referencing css
changed and swap between the following but still didnt work

styleUrls:['./forgot-password.component.css']
styleUrls:['forgot-password.component.css']

Thanks! We'll be in touch soon.

@mattdistefano
Copy link

#4778 maybe?

@clydin
Copy link
Member

clydin commented Feb 21, 2017

Are there any imports or url()'s in the stylesheet in question?

@ellipizle
Copy link
Author

yes, remove background-image: url(""); from css did solve my issue.
thanks @mattdistefano and @clydin

@edelfrade
Copy link

Any fix does not involve removing background-image: url("")?

Setting images to url("/assets/images/...") stops it from breaking and works with ng-serve but does not make the correct route change when building to production.

@filipesilva
Copy link
Contributor

Closing as answered.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
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

5 participants