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)
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.