SASS: Can't find stylesheet to import (node_module)
See original GitHub issueparcel src/index.html and parcel serve src/index.html work fine with my App.scss file:
$theme-colors: (
"primary": #8AFFA3,
);
@import "bootstrap/scss/bootstrap";
But then when I try to build for production using parcel build src/index.html i get this error:
> parcel build src/index.html
🚨 Build failed.
@parcel/transformer-sass: Can't find stylesheet to import.
â•·
5 │ @import "bootstrap/scss/bootstrap.scss";
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
src/App.scss 5:9 root stylesheet
Error: Can't find stylesheet to import.
â•·
5 │ @import "bootstrap/scss/bootstrap.scss";
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╵
src/App.scss 5:9 root stylesheet
Here is my index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./App.scss">
</head>
<body>
<div id="root"></div>
<script src="./index.tsx"></script>
</body>
</html>
_Originally posted by @Ethan-Arrowood in https://github.com/parcel-bundler/parcel/issues/3377#issuecomment-627095775_
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (2 by maintainers)
Top 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
ParcelJS solved my problem by being able to compile my Sass/Scss code into ... Error: Can't find stylesheet to import. ... Nodejs 8.11.0...
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 >Sass Error after upgrading vom v14 to v15 | Infragistics Forums
src/styles.scss - Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js): SassError: Can't find stylesheet to import.
Read more >Sass: @import
Sass extends CSS's @import rule with the ability to import Sass and CSS stylesheets, providing access to mixins, functions, and variables and combining ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I was using npm. I was able to fix it by changing the path to
@import "node_modules/bootstrap/scss/bootstrap";I have a similar issue. I was using the
npm:syntax inside my SASS files like this:This worked with
parcel src/index.pug, but not withparcel build src/index.pug. It did work, however, once I removed the main-property from my package.json which was set toindex.js:Parcel thought I was trying to build a library, but I was actually building a simple web page. I’m not sure what the connection is to my import statement, though.