Skip to content

tilde sass import from node_modules library #37

Closed
@dagda1

Description

@dagda1

Describe the bug

I have a sass file that includes an @import to a file in a package in node_modules

@import '~@cutting/component-library/src/styles/_index.scss';

I get this error:

Can't find stylesheet to import.

@import '~@cutting/component-library/src/styles/_index.scss';
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This is getting raised from this line in cssSnapshots.js

            transformedCss_1 = sass
                .renderSync({
                data: css,
                includePaths: [filePath],
            })
                .css.toString();

To Reproduce
Steps to reproduce the behavior:

  1. add an import to a package in node_modules

Expected behavior
The sass file should be properly parsed and the declarations created

Desktop (please complete the following information):

  • OS: OSX

Perhaps the node_modules folder should be added to includePaths in the call to sass.renderSync

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions