parcel icon indicating copy to clipboard operation
parcel copied to clipboard

@parcel/resolver-default: strings passed to WinAPI cannot contain NULs

Open SekSion opened this issue 5 months ago • 8 comments

Overall its what i have below that is giving issues, using latest parcel update with hopes this would get fixed but unsure if it is a bug on parcel side or other packages, any idea? Also the issue is not only this one i just need to keep re-running the command until it eventually runs correctly he gives the error sometimes on different libraries the only consistent one is "@parcel/resolver-default: strings passed to WinAPI cannot contain NULs"

image

🚨 Build failed.

@parcel/core: Failed to resolve '@fluentui/merge-styles' from './node_modules/.pnpm/@[email protected]_@[email protected][email protected]/node_modules/@fluentui/theme/lib/motion/AnimationStyles.js'

\node_modules.pnpm@[email protected]_@[email protected][email protected]\node_modules@fluentui\theme\lib\motion\AnimationStyles.js:1:27

1 | import { keyframes } from '@fluentui/merge-styles'; | ^^^^^^^^^^^^^^^^^^^^^^^^ 2 | /* Register the keyframes */ 3 | var EASING_FUNCTION_1 = 'cubic-bezier(.1,.9,.2,1)';

@parcel/resolver-default: strings passed to WinAPI cannot contain NULs

SekSion avatar Jan 09 '24 16:01 SekSion

Can you please share a repository where this error happens repeated/consistently for you?


We have seen various likely related errors as well:

On Windows on the Parcel CI, on varying tests

  1) javascript
       should compile workers to non modules if shouldScopeHoist = false:
     Failed to resolve '@parcel/transformer-js/src/esmodule-helpers.js' from 'D:/a/parcel/parcel/packages/transformers/js/src/JSTransformer.js'  

On the React Spectrum additionally as the reason (slightly different from yours because this is Linux):

ERR!     {
ERR!       message: 'file name contained an unexpected NUL byte',
ERR!       origin: '@parcel/resolver-default'
ERR!     }  

mischnic avatar Jan 09 '24 20:01 mischnic

Hi thanks for the fast reply the current repo im having this issue its company code so can't really share will need to try and repro on a different one.

This started happening when i installed FluentUI9(https://react.fluentui.dev/?path=/docs/concepts-introduction--page) on the repo, which it brings another library called Griffel(https://griffel.js.org/), i can try and create a standalone repo with it see if i can repro it there...

SekSion avatar Jan 09 '24 20:01 SekSion

Was able to repro on a seperate repo all i had to do was install FluentUI9 and make it try and render a button image will post link to Repo soon...

SekSion avatar Jan 09 '24 21:01 SekSion

Repo to test: https://github.com/SekSion/reactparcelnullissue

also version of node on the readme, and to make it work as my actual code we use pnpm, unsure if npm does the same

added a readme with some instructions, at first it was not reproing before, so what i did was add a new component to the app.js file from fluentUI9

then i deleted the parcel-cache folder and just re-ran the command and deleted the parcel-cache every time until it failed

SekSion avatar Jan 09 '24 22:01 SekSion

We are experiencing file name contained an unexpected NUL byte errors as well in our pnpm repo when running parcel build, after upgrading from 2.6.2 (😅) to 2.11.0. The errors occur intermittently, for different imports, and generally a retry is sufficient to build successfully.

theopolisme avatar Feb 01 '24 07:02 theopolisme

Correct its not a blocker but makes development a lot complicater because switching branches or something similar takes much more time, but yes after 2-3 retries sometimes a clean .pnpm cache clear is suficient to make it work

SekSion avatar Feb 01 '24 12:02 SekSion

Hi @SekSion

We have been running into similar intermittent build failures with our project(s) on Parcel v2.10.2. Occasionally our build pipeline will fail due to problems resolving random dependencies:

image

image

Our build script does a pnpm install before building, so I'm not sure why these resolutions fail. The specific dependency it chokes on seems to change each time. Our work around is to restart the build process until it completes successfully. This happens frequently in our AWS Codebuild CI/CD environment, but only rarely when building locally.

What version of Parcel are you using? A teammate (on Windows) wasn't able to build our project at all with Parcel 2.11.x due to the WinAPI error you mentioned, so we rolled back to Parce 2.10.2 temporarily as that seems to work for all of us (linux, macos and windows).

mellodev avatar Feb 01 '24 17:02 mellodev

my guess is the bump of napi that occurred between those versions but I haven't tested that theory yet.

devongovett avatar Feb 01 '24 18:02 devongovett

Also seeing this. Failures resolving random dependencies. Deleting .parcel-cache seems to fix it.

tylerreinhart avatar Feb 28 '24 20:02 tylerreinhart