parcel: Regressions in 2.8.3

šŸ› bug report

Upgrading parcel to 2.8.3 (from 2.8.2) caused some builds to break. It’s not clear what exactly happened, but I think everything was related to sass.

I don’t know if transformers are compatible with non-matching versions of parcel, but I didn’t try downgrading only transformer-sass.

šŸŽ› Configuration (.babelrc, package.json, cli command)

Not using babel.

I have a couple of local resolver plugins, only one of which I think is relevant - it aliases react to preact and is needed (AFAICT) to resolve those aliases in a monorepo where I also depend on react proper.

The only explicit parcel deps:

"@parcel/core": "2.8.3",
"@parcel/transformer-sass": "2.8.3",
"parcel": "2.8.3",

My setup builds a bunch of independent html sources using a shared parcel config.

😯 Current Behavior

  • Sass file changes don’t seem to trigger rebuilds in watch mode (when included from html via <link>)
  • Some builds fail with Error: Expected content key XXXXXXXXX to exist. I suspected that font faces with src: url(../relative/path.ttf) were the culprit, but I couldn’t confirm easily. Removing some of these didn’t seem to help.

I apologize, I reverted the upgrade later and don’t have an example of the original backtrace. They didn’t give me any particular clues as to what the problem was.

šŸ’ Possible Solution

Downgrading all things parcel to v2.8.2 caused everything to work as expected.

šŸŒ Your Environment

Software Version(s)
Parcel 2.8.3
Node 16.15.1
Yarn 3.3.1
Operating System Linux

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 5
  • Comments: 17 (6 by maintainers)

Most upvoted comments

@dsibinski: @mischnic I somehow can’t isolate this issue in a sample app. The real-world example, which I cannot fully share, is that we have a Layout component which renders children. In the file with this component we also import some external CSS

I think I am encountering the exact same issue and made a very minimal sample: https://github.com/lukaw3d/parcel-bundler_two-css-from-js_and-css-from-second-css

The gist seems to be: if you import multiple CSS files from JS, only the first CSS file can import other CSS files

flowchart LR
  parcel(parcel build --no-cache index.html) --> index.html --> index.js
  index.js --> a.css
  index.js --> b.css --> |issue| bb.css

Perhaps. In my case, building with --no-cache and/or removing .parcel-cache first made no difference, I end up in the same place as you with an Expected content key ### to exist error.

I’m having a similar issue with 2.8.3 builds failing w/ error Expected content key ### to exist. We don’t use sass or the sass-transformer in our project though. Build/serve works fine in 2.8.2 as you stated.

https://github.com/parcel-bundler/parcel/issues/6528

I’m experiencing the ā€œError: Expected content key XXXXXXXXX to existā€ issue as well after upgrading from v2.7.0 to v2.8.3. If I switch back to v2.7.0, the error goes away; but… if I delete my package-lock.json and node_modules (and .parcel-cache) and npm install, then I get the same error using v2.7.0. So it’s possible the issue was introduced earlier, but package-lock.json has been masking it.

@mellodev, you said v2.8.2 was working for you: if you remove package-lock.json and node_modules, then reinstall, does it begin to error at that version?