You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FileSystemInfo can not createSnapshot with symbol link #12246
What is the current behavior?
I install deps with npminstall(it can install faster), but the file tree in node_modules is special bacause npminstall install pkgs with symbol link to download and write less files.
The file tree looks like this
app
├── index.js
└── node_modules
├── [email protected]@a(real dir)
| ├── index.js
| └── node_modules
| └── b(symbol link to app/node_modules/[email protected]@b)
├── [email protected]@b(real dir)
| ├── index.js
| └── node_modules
| └── a(symbol link to app/node_modules/[email protected]@a)
├── a(symbol link to app/node_modules/[email protected]@a)
└── b(symbol link to app/node_modules/[email protected]@b)
Because of a,b is reference by each other, contextTimestampQueue and contextHashQueue in FileSystemInfo will never reach the end.
If the current behavior is a bug, please provide the steps to reproduce.
The minimal reproduction repo is here.
The reproduce step is
git clone [email protected]:killagu/npminstall_webpack.git
cd npminstall_webpack
npm i -g cnpm
# must use cnpm install
cnpm i
npm run build
Build snapshow will fail.
What is the expected behavior?
Use fs.lstat to get file info, and use target path to process.
Skip files if has been processed
Other relevant information:
webpack version: 5.11.0
Node.js version: 12.16.3
Operating System: macOS Big Sur 11.0.1 (20B29)
Hi @sokra, I found that some specific libs will still cause the snapshot to fail in v5.52.0, such as video.js. Install video.js in the above reproduction repo, and it can be reproduced after running.
git clone [email protected]:killagu/npminstall_webpack.git
cd npminstall_webpack
npm i -g cnpm
# must use cnpm install
cnpm i
# NEW: install the video.js library
cnpm install video.js -S
npm run build
<--- JS stacktrace --->
FATAL ERROR: invalid array length Allocation failed - JavaScript heap out of memory
Activity
alexander-akait commentedon Dec 21, 2020
Yep bug
killagu commentedon Dec 21, 2020
@alexander-akait Thanks for confirm, I can have a try to fix it.
fix: fix FileSystemInfo#createSnapshot with symbol link
fix: fix FileSystemInfo#createSnapshot with symbol link
fix: fix FileSystemInfo#createSnapshot with symbol link
alexander-akait commentedon Jan 25, 2021
Other example of the problem with symlinks #12503 (comment)
fix: fix FileSystemInfo#createSnapshot with symbol link
alexander-akait commentedon Mar 5, 2021
Another example #12810
webpack-bot commentedon Jun 4, 2021
This issue had no activity for at least three months.
It's subject to automatic issue closing if there is no activity in the next 15 days.
alexander-akait commentedon Jun 4, 2021
bump
iperzic commentedon Jul 23, 2021
Do we have an ETA on when this might be fixed?
fix: fix FileSystemInfo#createSnapshot with symbol link
alexander-akait commentedon Aug 18, 2021
#14019
qiqiboy commentedon Sep 9, 2021
Hi @sokra, I found that some specific libs will still cause the snapshot to fail in
v5.52.0, such asvideo.js. Installvideo.jsin the above reproduction repo, and it can be reproduced after running.alexander-akait commentedon Sep 9, 2021
@qiqiboy update wepback to the latest stable version
qiqiboy commentedon Sep 9, 2021
Yes, I have tried, but still fail.
alexander-akait commentedon Sep 9, 2021
Can't reproduce the problem
qiqiboy commentedon Sep 9, 2021
@alexander-akait my env info:
alexander-akait commentedon Sep 9, 2021
Increase your memory usage, file is so bug, not related to this problem