parcel: "[Error: std::bad_alloc]" on startup

πŸ› bug report

Running parcel serve --port 9000 ./src/index.tsx gets [Error: std::bad_alloc] and then exit

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

.parcelrc

{
  "extends": "@parcel/config-default",
  "transformers": {
    "*.{css,pcss}": [
      "@parcel/transformer-css"
    ],
    "*.{jpg,png,svg}": [
      "@parcel/transformer-raw"
    ]
  }
}

No babel config

πŸ€” Expected Behavior

No error!

😯 Current Behavior

[Error: std::bad_alloc]

πŸ”¦ Context

Trying to run Parcel v2 in Docker, and no idea why this is happening or ideas on debugging!

πŸ’» Code Sample

Private repo, so can’t provide the whole thing, but can provide snippets if anyone can suggest what’s useful

🌍 Your Environment

Software Version(s)
Parcel 2.0.0
Node 14.17.0
npm/Yarn yarn 1.22.10
Operating System alpine 3.13 under Docker

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 2
  • Comments: 15 (2 by maintainers)

Most upvoted comments

Add .parcel-cache to .dockerignore

Like @abawany - my fix was to remove the .parcel-cache folder…

I found in my case that in spite of the .dockerignore directive, the problem still happened. I changed my build line as follows: npm install && rm -rf .parcel-cache||true && npm run build . The build was done on macos catalina.