-
Notifications
You must be signed in to change notification settings - Fork 634
Closed
Labels
Description
Version
0.0.0
Operating System
windows 11
Browser
No response
What are the steps to reproduce this bug?
clean clone then run
yarn
yarn build
What is the expected behavior?
Build to be successful
What do you see instead?
D:\webiny-js\node_modules\fs-extra\lib\copy-sync\copy-sync.js:185
throw new Error('Source and destination must not be the same.')
^
Error: Source and destination must not be the same.
at checkPaths (D:\webiny-js\node_modules\fs-extra\lib\copy-sync\copy-sync.js:185:11)
at Object.copySync (D:\webiny-js\node_modules\fs-extra\lib\copy-sync\copy-sync.js:25:20)
at D:\webiny-js\scripts\buildPackages\src\getBatches.ts:87:16
at Generator.next (<anonymous>)
at fulfilled (D:\webiny-js\scripts\buildPackages\src\getBatches.ts:5:58)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
Additional information
No response
Possible solution
There are two issues at play. 1 is rimraf
and the other is fs-extra
.
rimraf
In version 4 they disabled globing in file paths by default and that has to be enabled as an option.
- https://github.com/webiny/webiny-js/blob/b609e37fc81bc24ef23c436d4d1849f0be6f9e70/packages/project-utils/packages/buildPackage.js:15 needs to be replaced with
rimraf.sync(join(cwd, "*.tsbuildinfo"), {glob:true});
- https://github.com/webiny/webiny-js/blob/4f3a75b0b1028e42689b7ea69a3e25925b7b3689/packages/project-utils/bundling/function/buildHandler.js:13 needs to be replaced with
rimraf.sync(join(cwd, "*.tsbuildinfo"), {glob:true});
fs-extra
Windows 11 has a new file system with their 'dev drives' feature. It uses ReFS. The older version of fs-extra
that's being used for builds does some interesting things when trying to compare source and destinations can fails. Its comparing inodes of the source and destination. This is where the issues is being surfaced.
Bumping versions of 'fs-extra' to version 11.2.0 fixes that issues.
I would put up a pull request but I am not sure the best way to do that