microsoft / vscode-js-debug

A DAP-compatible JavaScript debugger. Used in VS Code, VS, + more
MIT License
1.67k stars 283 forks source link

Unable to Build. TypeError: Cannot assign to read only property 'atime' of object '#<Stats>' #2008

Closed Devric closed 4 months ago

Devric commented 6 months ago

Describe the bug I'm trying to build this package to use with VIM debuger, but getting a type error when building

TypeError: Cannot assign to read only property 'atime' of object '#<Stats>'

To Reproduce Steps to reproduce the behavior:

  1. npm install --legacy-peer-deps
  2. npx gulp vsDebugServerBundle

image

└─(21:22:44 on main ✹)──> npx gulp vsDebugServerBundle                                                                                                                                           ──(Sun,May05)─┘
(node:5460) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
[21:22:50] Using gulpfile ~/.local/share/nvim/site/pack/packer/start/vscode-js-debug/gulpfile.js
[21:22:50] Starting 'vsDebugServerBundle'...
[21:22:50] Starting 'clean'...
[21:22:50] Finished 'clean' after 9.87 ms
[21:22:50] Starting 'compile'...
[21:22:50] Starting 'compile:static'...
(node:5460) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
[21:22:50] 'compile:static' errored after 50 ms
[21:22:50] TypeError: Cannot assign to read only property 'atime' of object '#<Stats>'
    at onFutimes (/Users/devric/.local/share/nvim/site/pack/packer/start/vscode-js-debug/node_modules/vinyl-fs/lib/file-operations.js:258:27)
    at FSReqCallback.oncomplete (node:fs:188:23)
    at FSReqCallback.callbackTrampoline (node:internal/async_hooks:130:17)
[21:22:50] 'compile' errored after 51 ms
[21:22:50] 'vsDebugServerBundle' errored after 63 ms
connor4312 commented 6 months ago

I'm not able to reproduce this. E.g. in a fresh Docker image:

PS C:\Users\conno\Github\vscode-js-debug> docker run -it node:22 /bin/bash
root@594420f4bbb6:/# git clone https://github.com/microsoft/vscode-js-debug.git
Cloning into 'vscode-js-debug'...
remote: Enumerating objects: 24762, done.
remote: Counting objects: 100% (387/387), done.
remote: Compressing objects: 100% (233/233), done.
remote: Total 24762 (delta 198), reused 305 (delta 150), pack-reused 24375
Receiving objects: 100% (24762/24762), 21.62 MiB | 5.67 MiB/s, done.
Resolving deltas: 100% (19049/19049), done.
root@594420f4bbb6:/# cd vscode-js-debug/
root@594420f4bbb6:/vscode-js-debug# npm i
<snip>
root@594420f4bbb6:/vscode-js-debug# npx gulp vsDebugServerBundle
(node:136) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
[15:20:05] Using gulpfile /vscode-js-debug/gulpfile.js
[15:20:05] Starting 'vsDebugServerBundle'...
[15:20:05] Starting 'clean'...
[15:20:05] Finished 'clean' after 11 ms
[15:20:05] Starting 'compile'...
[15:20:05] Starting 'compile:static'...
(node:136) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
[15:20:06] Finished 'compile:static' after 117 ms
[15:20:06] Starting 'compile:build-scripts'...
[15:20:06] Finished 'compile:build-scripts' after 381 ms
[15:20:06] Starting 'compile:dynamic'...
[15:20:06] Finished 'compile:dynamic' after 254 ms
[15:20:06] Starting 'compile:extension'...
[15:20:06] Finished 'compile:extension' after 146 ms
[15:20:06] Finished 'compile' after 899 ms
[15:20:06] Starting 'vsDebugServerBundle:webpack-bundle'...
[15:20:06] Finished 'vsDebugServerBundle:webpack-bundle' after 79 ms
[15:20:06] Starting 'l10n:bundle-download'...
[15:20:08] Finished 'l10n:bundle-download' after 1.82 s
[15:20:08] Finished 'vsDebugServerBundle' after 2.81 s
root@594420f4bbb6:/vscode-js-debug#

note that --legacy-peer-deps is not needed (but I didn't get the error if I added it).

If you want to try to update dependencies and find something that fixes this for you, I would happily take such a change in a PR.

Devric commented 6 months ago

It seems like it has something to do with file permission. If I'm using docker internal path its fine, but failed to build on volume mapped host path. Will do some more digging

connor4312 commented 4 months ago

Let me know if you get a repro for this.