When importing a .css file from within .scss file, an error with an unclear message is thrown:
~/Downloads/parcel-reproduce >>> npm run build
> [email protected] build /home/kuba/Downloads/parcel-reproduce
> parcel build index.html --out-dir=public
馃毃 /home/kuba/Downloads/parcel-reproduce/css/style.scss: Cannot resolve dependency '/home/kuba/Downloads/parcel-reproduce/home/kuba/Downloads/parcel-reproduce/css/reset.css' at '/home/kuba/Downloads/parcel-reproduce/home/kuba/Downloads/parcel-reproduce/css/reset.css'
at Resolver.resolve (/home/kuba/Downloads/parcel-reproduce/node_modules/parcel-bundler/src/Resolver.js:69:17)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `parcel build index.html --out-dir=public`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I'm on parcel 1.9.7. It didn't happen on <=1.8.1, so it looks like a regression
I've set up a minimal repository that reproduces this problem:
https://github.com/kuba-orlik/parcel-reproduce
Run npm run build to see the error message
It should build the scss file
It throws an error message, as shown above
I've upgraded the parcel-bundler version in one of my projects and this error started appearing. Renaming the file from reset.css to reset.scss and adjusting the import fixes the issue - but the error message wasn't very helpful in realizing that it's the file extension that causes the problem.
https://github.com/kuba-orlik/parcel-reproduce
| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.9.7
| Node | v10.6.0
| npm/Yarn | 6.1.0
| Operating System | Linux Manjaro
Any progress on it? Why can't parcel handle css importing in scss files?
Got the same issue with:
parcel 1.12.3
Node: 10.7.0
OS: MacOS
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.
Phew this problem still persists. Not for many - that seems to be a fact - but still. I've tried to install dart-sass which doesn't resolve the tilde operator correctly, so the problem seems to be to some degree with node-sass and parcel.
Edit:
On another project I omitted the file extension, which worked with dart-sass: @import '~react-day-picker/lib/style';