Skip to content

Can't find stylesheet to import. @USE inside node_modules #111

@pelord

Description

@pelord

Describe the bug
I have a setup file (as described in #90 (comment) ) to handle my "@use " since the last year (july 2021) run from gulp. Everything was fine.

here the command
'node ./node_modules/scss-bundle/dist/cli/main.js -p ./ -e ./packages/core/src/style/index.theming.scss -o ./dist/core/style/index.theming.scss

Since my migration to angular 13, I had to replace tilde to a full path import. Seem the -p ./ do not work anymore!

from ==> @use '~@angular/material/_index.scss' as mat; 
to   ==> @use './node_modules/@angular/material/_index.scss' as mat; 

So far so good.

In the next migration to angular 14, I hit this issue...

            '[10:19:00] erro: There is an error in your styles:\r\n' +
            "[10:19:00] erro: Can't find stylesheet to import.\n" +
            "[10:19:00] erro: 1 │ @use '@angular/cdk';\n" +
            '[10:19:00] erro:   │ ^^^^^^^^^^^^^^^^^^^\n' +
            '[10:19:00] erro:   ╵\n' +
            '[10:19:00] erro:   node_modules\\@angular\\material\\core\\style\\_menu-common.scss 1:1  @forward\n' +
            '[10:19:00] erro:   node_modules\\@angular\\material\\_index.scss 33:1                  @use\n' +
            '[10:19:00] erro:   stdin 1:1                                                        root stylesheet on line (1, 1)'

Any hint how to fix this issue?

Im running scss-bundle 3.1.2
On
Windows
Npm 8.14.0
Node 16.16.0
from nvm-windows

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://github.com/infra-geo-ouverte/igo2-lib
  2. Checkout branch ng14
  3. npm install
  4. run npm run gulp core:concatStyles
  5. See error

Expected behavior
An effective bundle creation ? ;)

Package version: v3.1.2
Node version: v16.16.0
OS: Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions