Open nickbreen opened 2 years ago
Error from serve
ERROR Failed to compile with 1 error 5:30:40 PM
error
Cannot destructure property `withFileTypes` of 'undefined' or 'null'.
@ ./.yarn/$$virtual/webpack-dev-server-virtual-31a67a73dd/0/cache/webpack-dev-server-npm-3.11.3-ba74f2e2c6-dfc70a0d96.zip/node_modules/webpack-dev-server/client?http://192.168.178.33:8081&sockPath=/sockjs-node 76:17-67
@ multi ./.yarn/$$virtual/webpack-dev-server-virtual-31a67a73dd/0/cache/webpack-dev-server-npm-3.11.3-ba74f2e2c6-dfc70a0d96.zip/node_modules/webpack-dev-server/client?http://192.168.178.33:8081&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js
The work-around is to use YARN_NODE_LINKER=node-modules
which disables the PnP system and avoids the yarn bug.
Version
4.5.15
Reproduction link
github.com
Environment info
Steps to reproduce
Clone repo. Install yarn classic Install node v10.22.1 Run:
What is expected?
Successful build without having to specify
--no-clean
or delete the output directory manually.Note that
serve
also fails with this same error and the above work-arounds do not work.What is actually happening?
$ yarn build
✔ Building for production... ERROR TypeError: Cannot destructure property
withFileTypes
of 'undefined' or 'null'. TypeError: Cannot destructure propertywithFileTypes
of 'undefined' or 'null'. at PosixFS.readdirPromise (/home/breenn/src/vue-cli-node-yarn-pnp-bug/.pnp.js:19178:23) at process.nextTick (/home/breenn/src/vue-cli-node-yarn-pnp-bug/.pnp.js:22205:20) at process._tickCallback (internal/process/next_tick.js:61:11)This is triggering a bug in yarn but only on the second
build
- which means there is something that the vue cli is doing differently the second time (and the first time withserve
), something to do with the cleaning the output directory.