Skip to content
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

Parser doesn't find the basic src/app/app.component.scss file #66

Open
leomayer opened this issue May 30, 2022 · 3 comments
Open

Parser doesn't find the basic src/app/app.component.scss file #66

leomayer opened this issue May 30, 2022 · 3 comments

Comments

@leomayer
Copy link

I try to run npm run unused-css and get as a response

> [email protected] unused-css
> ngx-unused-css

e Error: Styling file for component src/app/app.component.html not found, skipping...
    at /home.local/lw/workspace-my-app-ng/my-app-frontend/node_modules/ngx-unused-css/dist/src/helpers/unusedClassMapper.js:25:31
    at step (/home.local/lw/workspace-my-app-ng/my-app-frontend/node_modules/tslib/tslib.js:144:27)
    at Object.next (/home.local/lw/workspace-my-app-ng/my-app-frontend/node_modules/tslib/tslib.js:125:57)
    at /home.local/lw/workspace-my-app-ng/my-app-frontend/node_modules/tslib/tslib.js:118:75
    at new Promise (<anonymous>)
    at __awaiter (/home.local/lw/workspace-my-app-ng/my-app-frontend/node_modules/tslib/tslib.js:114:16)
    at unusedClassMapper (/home.local/lw/workspace-my-app-ng/my-app-frontend/node_modules/ngx-unused-css/dist/src/helpers/unusedClassMapper.js:15:34)
    at /home.local/lw/workspace-my-app-ng/my-app-frontend/node_modules/ngx-unused-css/dist/src/main/getUnusedClasses.js:48:52
    at Array.map (<anonymous>)
    at UnusedClasses.mapClasses (/home.local/lw/workspace-my-app-ng/my-app-frontend/node_modules/ngx-unused-css/dist/src/main/getUnusedClasses.js:42:33) /home.local/lw/workspace-my-app-ng/my-app-frontend
Error: Error: Error: Styling file for component src/app/app.component.html not found, skipping...
    at /home.local/lw/workspace-my-app-ng/my-app-frontend/node_modules/ngx-unused-css/dist/src/main.js:33:23

Running the command ll src/app/app.component.* I get

-rw-rw-r-- 1 lw users  167 22. Jun 2020  src/app/app.component.html
-rw-rw-r-- 1 lw users    0 26. Nov 2018  src/app/app.component.scss
-rw-r--r-- 1 lw users 1,1K 26. Nov 2020  src/app/app.component.spec.ts
-rw-rw-r-- 1 lw users  397 30. Mai 10:44 src/app/app.component.ts

The .ngx-unused-css.json

{
  "path": "src/app",
  "ignore": [
    ".mat-"
  ],
  "cli": true,
  "globalStyles": "src/styles.scss",
  "styleExt": ".scss"
}
@leomayer
Copy link
Author

The default file extension is .scss but the required format is scss! Therefore it cannot find a file with component..scss

@Mike-Becatti
Copy link

I'm having the same issue... @ivanblazevic - Are you still maintaining this library?

@ruanitto
Copy link

ruanitto commented Apr 5, 2023

Change the line 6 on .ngx-unused-css.json

...
"styleExt": ".scss"
...

To:

...
"styleExt": "scss"
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants