parcel icon indicating copy to clipboard operation
parcel copied to clipboard

Unstable breaking builds

Open elmar-hinz opened this issue 1 year ago • 2 comments

🐛 bug report

The build result sometimes works and sometimes breaks.

Screenshot 2023-06-11 at 11 32 15

When it breaks it reports, that the function select select is undefined, which get's imported from node module d3.

I apologise if similar bugs have already been reported. Such instabilities are quite unspecific by nature, so that specific search terms are missing.

🎛 Configuration (.babelrc, package.json, cli command)

It's the configuration of this commit: https://github.com/home-assistant-tutorials/20.mermaid-card/commit/02e83b52475545bc7f663bde3142c52479ef8383

{
  "source": "src/index.js",
  "module": "dist/card.js",
  "targets": {
    "module": {
      "includeNodeModules": true
    }
  },
  "scripts": {
    "watch": "parcel watch",
    "build": "parcel build"
  },
  "devDependencies": {
    "parcel": "^2.8.3"
  },
  "dependencies": {
    "lit": "^2.7.4",
    "mermaid": "^10.2.3"
  }
}

🤔 Expected Behavior

Screenshot 2023-06-11 at 11 47 23

😯 Broken Behavior

Screenshot 2023-06-11 at 11 45 49

In the moment the behaviour does not happen as I want to copy the stack trace.

💁 Possible Solution

Sometimes it helps, to just run npm run build again. Sometimes it helps to delete .parcel-cache/ and dist/ before.

🔦 Context

I am running the code inside a docker container on a recent Mac. The directory is mounted. There could be writing instabilities during generation, although I don't observe complaints of a missing file.

The code is called inside a Lit based HTML custom element so inside a shadow DOM as well.

🌍 Your Environment

See repository. Mac Mini 2023. Docker desktop 4.19.0.

elmar-hinz avatar Jun 11 '23 10:06 elmar-hinz

I am experiencing a similar problem with Parcel 2.9.2+. The minified build/dist output differs from that served through the dev server. The dist output is missing a symbol for react-router which breaks the entire app. Meanwhile everything works properly while serving with the dev server.

Our app builds correctly with 2.8.1, so I assume this bug was introduced in 2.9.x!

mellodev avatar Jul 07 '23 17:07 mellodev

Please provide a small code sample that reproduces the issue.

mischnic avatar Jan 08 '24 15:01 mischnic