TypeError [ERR_INVALID_ARG_VALUE]: The argument 'path' must be a string or Uint8Array without null bytes.
See original GitHub issueI 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:
- Created 3 years ago
- Comments:9 (5 by maintainers)
Top Related StackOverflow Question
You actually may not worry about setting --cache-folder in the container, it uses system tmp.
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--polloption if you watching volumes.