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.

Building simple TS file randomly throws 3221226356 exit code

See original GitHub issue

🐛 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

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:4
  • Comments:29 (8 by maintainers)

github_iconTop GitHub Comments

6reactions
devongovettcommented, Jan 27, 2022

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.

4reactions
devongovettcommented, Jan 26, 2022

Does it work for anyone if you set the PARCEL_WORKER_BACKEND=process environment variable?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building simple TS file randomly throws 3221226356 exit code ...
The zero configuration build tool for the web. . Contribute to parcel-bundler/parcel development by creating an account on GitHub.
Read more >
Getting "exited with code=3221226356" error ... - Stack Overflow
These two lines are a likely problem: char * file_name_path = strdup(path); strcat(file_name_path, separator);.
Read more >
Keep getting "exited with code=3221226356 in x seconds" in ...
The problem is the value m exceeds the limit of an integer so i will never reach it. Below shows how it can...
Read more >
terminal exit code: 3221225477 Code Example - Code Grepper
Can resolve by clearing the cache npm cache clean --force # or yarn cache clean --force.
Read more >
Bug #72451 :: Wordpress/ stream_get_wrappers causes crash
I tested it out with a simple php script unassociated with Wordpress and I have seen it stall out in the middle of...
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