TypeError [ERR_INVALID_ARG_VALUE]: The argument 'path' must be a string or Uint8Array without null bytes.

See original GitHub issue

I am using ts-node-dev in my project (+3K source files).

As a local development machine I am using macOS Catalina and everything is fine.

Once I run project in Docker container (Debian GNU/Linux 9 (stretch)) I am getting weird errors for random files.

Error is always same (The argument 'path' must be a string or Uint8Array without null bytes.):

[DEBUG] 22:16:25 /home/wwwroot/myproject/packages/gql/src/modules/news-feed-extended/news-feed-extended.service.ts compiled in 16 ms
Compilation error in /home/wwwroot/myproject/packages/gql/src/modules/name-data/name-data.service.ts
TypeError [ERR_INVALID_ARG_VALUE]: The argument 'path' must be a string or Uint8Array without null bytes. Received '/home/wwwroot/myproject/packages/gql/.cache/compiled/src_modules_name_data_name_data_service_ts_c3f5059df45d91d7833d37093922a081...
    at Object.openSync (fs.js:454:10)
    at Object.writeFileSync (fs.js:1362:35)
    at writeCompiled (/home/wwwroot/myproject/node_modules/ts-node-dev/lib/compiler.js:218:30)
    at Object.compile (/home/wwwroot/myproject/node_modules/ts-node-dev/lib/compiler.js:241:17)
    at /home/wwwroot/myproject/node_modules/ts-node-dev/lib/index.js:135:30
    at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3)
error Command failed with exit code 1.

Important is that it’s always different file. I am pretty sure, that this files are valid, I can run it outside docker.

I don’t totally understand what is wrong. Any tips?

Both system are using v12.18.3 ts-node-dev version is "ts-node-dev": "^1.0.0-pre.61"

Starting command is: yarn ts-node-dev --debug --no-notify --respawn --transpile-only --ignore-watch node_modules --cache-directory .cache --watch src src/boot.ts

Thank you in advice

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
wclrcommented, Oct 15, 2020

You actually may not worry about setting --cache-folder in the container, it uses system tmp.

1reaction
wclrcommented, Oct 15, 2020

Something wrong with --cache-directory. Btw you don’t want the cache directory to be on the docker volume (if you are mounting your code with volumes). Outside docker, it will be faster of course. Also, you may need --poll option if you watching volumes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The argument 'path' must be a string or Uint8Array without null ...
Before the update, I got the Error " The argument 'path' must be a string or Uint8Array without null bytes" only in my...
Read more >
Error: The argument 'path' must be a string or Uint8Array ...
Trying to get a site using Express.js I'm working to display a pdf on the site. Attempting to use fs and path to...
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 >
The Node.js API
5.4.11 Static method Buffer.from(string[, encoding]). ... INSPECT MAX BYTES . ... 15.2.137 DEP0139 process.umask() with no arguments.
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