question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't find stylesheet to import

See original GitHub issue

🐛 bug report

Can’t import any node_module to scss file. Tried like:

@import 'bourbon';
@import '~/bourbon/core/_bourbon.scss';
@import '~/node_modules/bourbon/core/_bourbon.scss';

🎛 Configuration (.babelrc, package.json, cli command)

No configs was used

🤔 Expected Behavior

Guess what…

😯 Current Behavior

🚨  /src/layouts/main/MainLayout.scss:2:9: Can't find stylesheet to import.
  ╷
2 │ @import '~/node_modules/bourbon/core/_bourbon.scss';
  │         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  ╵
  src/layouts/main/MainLayout.scss 2:9  root stylesheet

💁 Possible Solution

Works only if I enter path like

@import '~node_modules/bourbon/core/bourbon';
/* or this */
@import '~bourbon/core/_bourbon.scss';

NOTE no / after ~ But in documentation its not mentioned

🔦 Context

💻 Code Sample

https://github.com/FDiskas/parcel-bug

🌍 Your Environment

Software Version(s)
Parcel 1.12.3
Node v10.16.0
npm/Yarn 6.9.0/1.16.0
Operating System Fedora (LINUX)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
FDiskascommented, Apr 20, 2020

I’m sorry I totally forgot about workaround. But still it’s not works as it’s supposed to

1reaction
DeMoorJaspercommented, Apr 20, 2020

@FDiskas I doubt we’ll fix this in Parcel 1, we’ve been tweaking and changing this quite a lot and changing this again would be a breaking change.

Parcel 2 will hopefully be more reliable for this, we’re still trying to figure out how we should handle this properly due to the various different standards for these imports. Even with webpack and postcss import you can define your own prefix. Maybe we should just default to the node.js standard and allow this to be customized using postcss plugins.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sass "Error: Can't find stylesheet to import." - Stack Overflow
It seems like this is a path issue; _functions.scss is in the same directory as bootstrap.scss in node_modules/bootstrap/scss , but it seems ...
Read more >
Error: Can't find stylesheet to import. · Issue #3269 - GitHub
use the proper relative import (i.e. @import "abstracts/reset" ); define a load path from which imports can be resolved (which might be what ......
Read more >
Executing Sass - Can't find stylesheet to import - Syncfusion
Hi :) I'm currently trying to do the following: code.png. So I import the base styles, then I override some scss variables, and...
Read more >
SCSS Error: Can't find stylesheet to import.
the error comes from SASS compiler, not from the IDE. IDE tricks, like marking folders as Resource roots, won't work here, the compiler...
Read more >
Laravel NPM run Dev error "Can't find stylesheet to import."
node_modules/sass-loader/dist/cjs.js): SassError: Can't find stylesheet to import. @import "~compass/css3"; I already installed compass and compass-mixins.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found