Skip to content

Cannot import CSS from node_modules using "~" pattern #382

Closed
@ashubham

Description

Describe the bug

@import '~npm_package/path/file.scss';

// styles here

Throws error:

Error: Can't find stylesheet to import.

This seems related to #291 . But the problem here is when a ~ is prefixed.

System Info

  • required vite version: 0.20.7
  • required Operating System: OSX
  • required Node version: 12.11.0

Logs (Optional if provided reproduction)

Error: Can't find stylesheet to import.
  ╷
1 │ @import '~@bootstrap/styles/_base.scss';
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  ../js/ts-packages/radiant-react/widgets/alert/muted/muted-alert.scss 1:9  root stylesheet
    at Object._newRenderError (/Users/ashish.shubham/thoughtspot/blink-v2/node_modules/sass/sass.dart.js:14477:19)
    at Object._wrapException (/Users/ashish.shubham/thoughtspot/blink-v2/node_modules/sass/sass.dart.js:14324:16)
    at StaticClosure._renderSync (/Users/ashish.shubham/thoughtspot/blink-v2/node_modules/sass/sass.dart.js:14299:18)
    at Object.Primitives_applyFunction (/Users/ashish.shubham/thoughtspot/blink-v2/node_modules/sass/sass.dart

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions