Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails with warning The "path" argument must be of type string. Received null #12796

Open
gaborbernat opened this issue Oct 21, 2022 · 2 comments

Comments

@gaborbernat
Copy link

I don't have reproducible for this as the project is private. However i'm using react-scripts 5.0.1 with typescript 4.8.4.

Describe the bug

Build fails with:

❯ env CI=true npm run build

> packages.dev.bloomberg.com@1.0.0 build
> react-scripts build

Creating an optimized production build...

Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.

Failed to compile.

The "path" argument must be of type string. Received null

The "path" argument must be of type string. Received null

The "path" argument must be of type string. Received null

The "path" argument must be of type string. Received null

There's no mention of what path and where though 🤔

@Librazy
Copy link

Librazy commented Nov 7, 2022

If there is any file in build/static/js, the build fails.

rm -rf build || true
yarn build # it works

rm -rf build || true
mkdir -p build/static/js/ && touch build/static/js/main.a116ca1c.js
yarn build # fails with 'The "path" argument must be of type string. Received an instance of Buffer'

@alienzhangyw
Copy link

I got this error message:

Failed to compile.

p.replace is not a function

Manually delete 'build' folder then rebuild works.
Maybe cra should use webpack 5 output.clean feature to clean the build folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@gaborbernat @Librazy @alienzhangyw and others