Parcel: CSS glob import breaking on new file

Created on 28 Apr 2019  路  6Comments  路  Source: parcel-bundler/parcel

馃悰 bug report

Parcel throws an error when adding a new file whilst using glob imports in css files

馃帥 Configuration (.babelrc, package.json, cli command)

Out of the box

馃 Expected Behavior

Reloads watcher when new file is added in the globbed css import

馃槸 Current Behavior

Parcel throws an error saying file not found

Error: ENOENT: no such file or directory

馃捇 Code Sample

Folder Structure:
styles/one.css
styles/two.css
styles.three.css
main.css

Import declaration in main.css:
@import './styles/*.css';

馃實 Your Environment

| Software | Version(s) |
| ---------------- | ---------- |
| Parcel | 1.12.3
| Node | 12.0.0
| npm/Yarn | 6.9.0/1.15.2
| Operating System | osx 10.14.4

Bug CSS Preprocessing Stale

Most helpful comment

I just proposed a fix. I'm not sure what further steps are required re: testing, and I don't have a lot of time/energy for that, but I found the bug.

All 6 comments

This error comes with sass and scss too.
Got an index.sass file and doing imports like:

// Import templates
@import '../../template/**/*.sass'

Getting error:

Error: File to import not found or unreadable

that would help allot. Ability to import css|scss files with glob :calendar:

I am running into this too but with .tsx files.

I just proposed a fix. I'm not sure what further steps are required re: testing, and I don't have a lot of time/energy for that, but I found the bug.

This should probably get the label Watcher.

I am running into #2749 when I delete a file in VS Code, and this bug when I add a file in VS Code. So basically glob watching is broken on adding and deleting files.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

466023746 picture 466023746  路  3Comments

dsky1990 picture dsky1990  路  3Comments

humphd picture humphd  路  3Comments

algebraic-brain picture algebraic-brain  路  3Comments

Niggler picture Niggler  路  3Comments