unplugin-icons
unplugin-icons copied to clipboard
Failed to read source code from /vercel/path0/_virtual_~icons/mdi/instagram.jsx
I get this when building on Vercel, and sometimes locally (using Nextjs). Redeploying usually fixes the issue
./_virtual_~icons/mdi/instagram.jsx
--
17:44:39.823 | Error: Failed to read source code from /vercel/path0/_virtual_~icons/mdi/instagram.jsx
17:44:39.824 | Â
17:44:39.824 | Caused by:
17:44:39.824 | No such file or directory (os error 2)
Same here. Super annoying. Have to remove node_modules and reinstall every time this happens.
Should note: even that doesn't consistently fix it.
I'm also getting this constantly on build—locally or to Vercel. I'm using SvelteKit. Everything works great in development, rebuilding doesn't fix it.

I have the same issue from time to time with Nextjs locally. A fix for me is to delete the .next
folder and then rerun yarn run dev
.
Using virtual:icons
instead of ~icons
to reference icons has seemed to fix it for me.
I met this kind of error with webpack --watch
first, then I exit webpack then execute it again, the error did not resurface again.
encountered repeatly. I remove dir node_modules and tentatively remove this webpack config cacheDirectory: true
.
hope it go well without this error.
Any update on this? it's quite annoying, i have to delete the .next
folder often to make this work.
I have exactly the same issue with NextJs and it is truly annoying. The solution is to delete .next
folder and re-run the dev command. The problem is that it happens absolutely randomly – after the 5th or 10th re-launch of a project, which may make reproducing it an unobvious, but still doable, task. I have arranged a reproduction on Stackblitz – https://stackblitz.com/edit/stackblitz-starters-arrh29?file=pages%2Findex.js.
- After opening it, finish the process with ctrl+c.
- Run
npm run dev
command, and kill it again. - Repeat until getting the following result:
It took me 5 attempts to finally get the error.
wait - compiling / (client and server)...
error - ./_virtual_~icons%2Fri%2Faliens-fill.jsx
ENOENT: no such file or directory, open '/home/projects/stackblitz-starters-arrh29/_virtual_~icons%2Fri%2Faliens-fill.jsx'
Need to note that on my local project, I have tried it with auto-import and it didn't fix the problem.
@antfu can you fix this problem? as i see this bug very old
Had this issue for the first time today, never had it before, retriggering the pipeline manually fixed it. It may be due to vercel build cache i suppose
Same Problem. removing .next folder and running again will fix it. but the issue happens too much