unplugin
unplugin copied to clipboard
Webpack 5 build errors with persistent/disk cache
Reproduction link: https://github.com/Akryum/unplugin-icons-issue-94
- Build a webpack 5 project with persistent caching -> Success
- Build again -> Success
- Build again -> Error
The build crashes with errors - examples:
error in ./virtual:~icons/feather/smile
Syntax Error: no such file or directory, open '/home/akryum/Projects/livestorm-app/packages/frontend/virtual:~icons/feather/smile'
error in ./virtual:~icons/feather/x-circle
Syntax Error: no such file or directory, open '/home/akryum/Projects/livestorm-app/packages/frontend/virtual:~icons/feather/x-circle'
error in ./virtual:~icons/feather/x
Syntax Error: no such file or directory, open '/home/akryum/Projects/livestorm-app/packages/frontend/virtual:~icons/feather/x'
Related to https://github.com/antfu/unplugin-icons/issues/94
Commenting the load part of the unplugin plugin (here) makes the error go away. So the issue is probably related to load.
So when the error happens, resolveId is not called and then plugin.__vfsModules doesn't have the virtual module so it fails.
Maybe related to https://github.com/sysgears/webpack-virtual-modules/issues/76
Looks like there is an open PR: https://github.com/sysgears/webpack-virtual-modules/pull/128
https://github.com/sysgears/webpack-virtual-modules/pull/164 It looks like fixed with [email protected] but I still got the error with vercel build:
Since the upstream issue is resolved, we can close this issue?