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.

The argument 'path' must be a string or Uint8Array without null bytes.

See original GitHub issue

Environment


  • Operating System: Windows_NT
  • Node Version: v14.18.0
  • Nuxt Version: 3-3.0.0-27234368.47ea41d
  • Package Manager: Yarn
  • Bundler: Webpack
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Describe the bug and expected behavior

Getting error:

Nuxt CLI v3.0.0-27234368.47ea41d                                                                                                                                                                       14:37:33
                                                                                                                                                                                                       14:37:33
  > Local:    http://localhost:3000/
  > Network:  http://129.11.79.100:3000/
  > Network:  http://192.168.0.115:3000/
  > Network:  http://192.168.0.130:3000/
  > Network:  http://172.17.31.33:3000/
  > Network:  http://192.168.102.129:3000/

i Vite warmed up in 980ms                                                                                                                                                                              14:37:36
√ Generated nuxt.d.ts                                                                                                                                                                                  14:37:36
√ Vite server built in 1025ms                                                                                                                                                                          14:37:36
√ Nitro built in 212 ms                                                                                                                                                                                14:37:37
Server Side Rendering Error: TypeError [ERR_INVALID_ARG_VALUE]: The argument 'path' must be a string or Uint8Array without null bytes. Received 'C:\\nodesites\\nuxt-vue-3\\nuxt3-app\\\x00virtual:C:\\nodesites\\nuxt-vue-3\\nuxt3-app\\.nuxt\\css.mjs'
    at statSync (fs.js:1124:10)
    at tryStatSync (internal/modules/esm/resolve.js:109:13)
    at finalizeResolution (internal/modules/esm/resolve.js:301:17)
    at moduleResolve (internal/modules/esm/resolve.js:731:10)
    at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:842:11)
    at Loader.resolve (internal/modules/esm/loader.js:89:40)
    at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
    at Loader.import (internal/modules/esm/loader.js:177:28)
    at importModuleDynamically (internal/modules/esm/translators.js:114:35)
    at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:30:14) {
  code: 'ERR_INVALID_ARG_VALUE'
}

Steps to reproduce

  1. npx nuxi init nuxt3-app
  2. cd nuxt3-app
  3. yarn install
  4. yarn dev
  5. open browser at http://localhost:3000

Additional context

Message only shows when I open the browser

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:6
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
syifengcommented, Oct 20, 2021

Got the same Error:

Server Side Rendering Error: TypeError [ERR_INVALID_ARG_VALUE]: The argument 'path' must be a string or Uint8Array without null bytes. Received '/Users/……/nuxt3-app/\x00virtual:/Users/……/nuxt3-app/.nuxt/css...
    at statSync (fs.js:1124:10)
    at tryStatSync (internal/modules/esm/resolve.js:109:13)
    at finalizeResolution (internal/modules/esm/resolve.js:301:17)
    at moduleResolve (internal/modules/esm/resolve.js:731:10)
    at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:842:11)
    at Loader.resolve (internal/modules/esm/loader.js:89:40)
    at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
    at Loader.import (internal/modules/esm/loader.js:177:28)
    at importModuleDynamically (internal/modules/esm/translators.js:114:35)
    at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:30:14) {
  code: 'ERR_INVALID_ARG_VALUE'
}
- Operating System: `macOS 11.6 (20G165)`
- Node Version:     `v14.18.1`
- Nuxt  Version:     `v3.0.0-27234503.d5127e9 `
- Package Manager:  `yarn`
- Bundler:          `Vite server`
- User Config:      `None`

with package.json

{
  "private": true,
  "scripts": {
    "dev": "nuxt dev",
    "build": "nuxt build",
    "start": "node .output/server/index.mjs"
  },
  "devDependencies": {
    "nuxt3": "latest"
  }
}

There is something changed when i update my npm from 6.14.15 to 8.1.0, this is important

Before the update, I got the Error " The argument ‘path’ must be a string or Uint8Array without null bytes" only in my output of terminal. The project is run well on the browser.

After the update, I just get 500 Error with the same error information on my browser.

the project is broken totally. Below is the content of what the browser showed

500

The argument 'path' must be a string or Uint8Array without null bytes. Received '/Users/..../nuxt3-app/\x00virtual:/Users/.../nuxt3-app/.nuxt/css...

at statSync (fs.js:1124:10)
at tryStatSync (internal/modules/esm/resolve.js:109:13)
at finalizeResolution (internal/modules/esm/resolve.js:301:17)
at moduleResolve (internal/modules/esm/resolve.js:731:10)
0reactions
nkilmcommented, Jul 29, 2022

Renaming your project folder fixes the problem. If this does not work then move your project to other directory, it should fix the error.

Also please note that, the project should not contain the name of the framework. E.g,. project name react-app throws error for react projects.

Read more comments on GitHub >

github_iconTop Results From Across the Web

fs.statSync with Buffer "Error: Path must be a string without null ...
I think the documentation for fs.statSync(path) is ambiguous. I believe it is saying that it wants a path. The path can be <string> ......
Read more >
[Solved]-Passing buffer as Uint8Array without null bytes-node.js
The documentation states that, in Node JS, the img parameter should be a path to a local image. On a browser, an image...
Read more >
How can null characters in a string be ignored? - General
But I get a data type error in the debug message. "TypeError: The argument 'newPath' must be a string or Uint8Array without null...
Read more >
Request to create custom user greeting returns socket hang ...
When I run this code I get the error: "The argument 'path' must be a string or Uint8Array without null bytes".
Read more >
How to create read stream from buffer? : r/node - Reddit
... response, body){ // // Error: Path must be a string without null bytes // ↓ form.attachment = fs.createReadStream(body) request.post({ ...
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