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.

`parcel build` hangs on a random file

See original GitHub issue

🐛 bug report

parcel build hangs, on a seemingly random file. My problem sounds identical to the one described in https://github.com/parcel-bundler/parcel/issues/6760. Passing the --no-optimize flag causes the build to succeed. I’ve also, through testing different configurations in my .parcelrc, discovered that removing the @parcel/transformer-js transformer allows the build to succeed, too (although the resulting build is unusable). parcel serve works fine.

My project comprises Elm and TypeScript (no .js, and literally one .css file with two lines, both of which are @imports).

🎛 Configuration

package.json excerpt

{
  ...
  "engines": {
    "node": "^17.3.0"
  },
  "source": "src/index.html",
  "browserslist": "> 0.5%, last 2 versions, not dead",
  "pwaManifest": {
    ...
  },
  "devDependencies": {
    ...
    "@parcel/packager-raw-url": "^2.2.1",
    "@parcel/packager-xml": "^2.2.1",
    "@parcel/service-worker": "^2.2.1",
    "@parcel/transformer-elm": "^2.2.1",
    "elm": "latest-0.19.1",
    "parcel": "^2.2.1",
    "parcel-config-pwa-manifest": "^0.1.0",
    "typescript": "^4.5.4"
    ...
  },
  ...
}

.parcelrc

{
  "extends": ["@parcel/config-default", "parcel-config-pwa-manifest"],
}

🤔 Expected Behavior

parcel build succeeds without incident.

😯 Current Behavior

parcel build hangs indefinitely on a random file.

https://user-images.githubusercontent.com/13547385/150435837-9f204470-961b-4a1f-9217-0c9ed1d5622c.mov

parcel build --no-optimize succeeds. parcel serve works fine.

🔦 Context

I just transitioned this project from Webpack 5. Everything has worked swimmingly, except for this!

💻 Code Sample

Unfortunately, the project in which I’m experiencing this issue is private, and I can’t share the source code. I’m also not sure how to narrow the issue down any further than I have, but am more than willing to try if given suggestions on how!

🌍 Your Environment

Software Version(s)
Parcel 2.2.1
Node 17.3.0
npm/Yarn 8.3.0
Operating System macOS Monterey 12.1

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
mischniccommented, Jan 25, 2022

👍 Perfect

Upstream swc issue for that terser/lezer problem: https://github.com/swc-project/swc/issues/3366 This was introduced recently when we enabled transpiling of node_modules

2reactions
mischniccommented, Jan 24, 2022

Then please also try to simplify the non-Elm parts so that you can share your code

Read more comments on GitHub >

github_iconTop Results From Across the Web

CLI - Parcel
The parcel CLI is the most common way to use Parcel. It supports three different commands: serve, watch, and build.
Read more >
Crashes - Android Developers
An Android app crashes whenever there's an unexpected exit caused by an unhandled exception or signal. An app that is written using Java...
Read more >
node.js - Parcel keeps throwing invalid parcel config or zsh ...
Whenever I use the command npx parcel src/index.html, I get a zsh: segmentation fault. No matter what, I cannot seem to build the...
Read more >
ArcPy script stops running randomly with no error returned
The symptoms you describe are to me typical of running a script/tool with insufficient RAM available for the size of input datasets, ...
Read more >
Bundling and Building with Parcel - Beginner JavaScript
Parcel is able to detect when your files have changed and it will only rerun the build on those files. The random keys...
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