parcel: Building simple TS file randomly throws 3221226356 exit code
π bug report
When building a relatively simple TypeScript file, it will build some of the time, but not others. For example, given the following TS file:
const config = {
serverPort: 3000,
};
export default config;
It will semi-randomly throw the error code 3221226356
π Configuration (.babelrc, package.json, cli command)
{
"name": "@streampods/internalconfig",
"description": "For internal use only. To share simple values between internal apps",
"version": "0.0.0",
"private": true,
"source": "index.ts",
"main": "dist/main.js",
"module": "dist/module.js",
"types": "dist/types.d.ts",
"scripts": {
"build": "parcel build"
},
"devDependencies": {
"@parcel/packager-ts": "^2.2.1",
"@parcel/transformer-typescript-types": "^2.2.1",
"parcel": "^2.2.1",
"typescript": "^4.5.4"
}
}
π€ Expected Behavior
No error should be thrown
π― Current Behavior
When running build repeatedly, I get different results, but most of the time results in an exit code
ξ° π ξ° ο ξ± git ξ± repro ξ± config ξ° ξ main β’ο +6 |ο ~1 -1 ξ°
β³ yarn build
yarn run v1.22.17
$ parcel build
β Built in 480ms
dist\main.js 557 B 142ms
dist\module.js 239 B 113ms
dist\types.d.ts 115 B 24ms
Done in 1.01s.
ξ° π ξ° ο ξ± git ξ± repro ξ± config ξ° ξ main β’ο +6 |ο ~1 -1 ξ°
β³ yarn build
yarn run v1.22.17
$ parcel build
β Built in 469ms
error Command failed with exit code 3221226356.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ξ° π ξ° ο ξ± git ξ± repro ξ± config ξ° ξ main β’ο +6 |ο ~1 -1 ξ° ο ξ°
β³ yarn build
yarn run v1.22.17
$ parcel build
β Built in 464ms
dist\main.js 557 B 142ms
dist\module.js 239 B 113ms
dist\types.d.ts 115 B 24ms
error Command failed with exit code 3221226356.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
π Possible Solution
Unfortunately, I have no idea what might be causing this problem.
π¦ Context
Iβm trying to use parcel
to build a internal dependency in a TurboRepo monorepo for usage in both NodeJS (CJS) and Browser (ESM) applications
π» Code Sample
Minimal reproduction lives here:
https://github.com/oceanbit/parcel-3221226356-repro
π Your Environment
Software | Version(s) |
---|---|
Parcel | 2.2.1 |
Node | 16.13.1 |
npm/Yarn | 1.22.17 |
Operating System | Windows 11 |
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 4
- Comments: 29 (8 by maintainers)
I think we narrowed this down to an upgrade of napi-rs in the
@parcel/source-map
package, which was released sometime after Parcel 2.2.1. I still donβt know the exact root cause, but for now Iβve reverted this upgrade and published@parcel/source-map
v2.0.2. See https://github.com/parcel-bundler/source-map/pull/91.Youβll need to remove
@parcel/source-map
2.0.1 from your lock file and re-install to get the upgrade. Please comment whether this works for you. Apologies again for the issue, and thanks for your patience while we track it down.Does it work for anyone if you set the
PARCEL_WORKER_BACKEND=process
environment variable?Same problem.
Same problem. Sometimes the exit code yarn reports is
3221225477
.Parcel version
2.0.0-rc.0
does not show this issue according to some limited testing.BTW. I am running as a non-priveleged user account.
3221225477 could be access violation on Windows? https://github.com/nodejs/node/blob/842e5a10ac59c826f875ef79e92d144e2655cc9a/test/common.js#L502-L505