Error: Module not found: Error: Can't resolve src/app/app.component.css?ngResource Angular
Asked Answered
D

2

6

I'm facing this 3 problems that I still can't understand where your mistakes are.

Error: Module not found: Error: Can't resolve 'C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css?ngResource' in 'C:\Users\DexSh\desktop\C# Angular\Testing'

Error: Module not found: Error: Can't resolve 'C:\Users\DexSh\desktop\C# Angular\Testing\node_modules\webpack-dev-server\client\index.js?protocol=auto%3A&username=&password=&hostname=0.0.0.0&port=0&pathname=%2Fng-cli-ws&logging=info&overlay=%7B%22errors%22%3Atrue%2C%22warnings%22%3Afalse%7D&reconnect=10&hot=false&live-reload=true' in 'C:\Users\DexSh\desktop\C# Angular\Testing'

Error: The loader "C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css" didn't return a string.

when using ng build returns this


Warning: ▲ [WARNING] Comments in CSS use "/* ... */" instead of "//" [js-comment-in-css]

    C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css:1:18:
      1 │ /******/ (() => { // webpackBootstrap
        ╵                   ~~



Warning: ▲ [WARNING] Unexpected "(" [css-syntax-error]

    C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css:1:9:
      1 │ /******/ (() => { // webpackBootstrap
        ╵          ^





Error: Module not found: Error: Can't resolve 'C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css?ngResource' in 'C:\Users\DexSh\desktop\C# Angular\Testing'

Error: The loader "C:/Users/DexSh/desktop/C# Angular/Testing/src/app/app.component.css" didn't return a string.

Can anyone tell me what's causing this, it's in every project

Waiting for a normal build and project execution

Dormer answered 12/12, 2022 at 2:33 Comment(2)
First of all, using a # in your folder path isn't a very good idea... You might want to change your C# Angular folder name to something without spaces or special symbols. Once you've changed that, you're going to want to fix the syntax errors in your css file(s) (ex. app.component.css) to allow the compiler to load the contents correctly.Eda
I thank you too much, I was curious trying to identify the problem and forgot the possibility of being the name of the root folder, I use folders in this style but in other projects and never had problems, but I will use without special characters. the syntax is not in trouble I just checked and it's perfect, apparently it was just the name of the folder, thanks there for the alertDormer
A
6

The problem is that you have a # in your folder name -> (C# Angular). This f. problem made me to go on rampage too...

Astronaut answered 24/1, 2023 at 15:7 Comment(0)
S
1

Please remove '#' from your folder or subfolder.

Sommers answered 15/2 at 18:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.