unplugin / unplugin-icons

🤹 Access thousands of icons as components on-demand universally.
https://www.npmjs.com/package/unplugin-icons
MIT License
3.65k stars 131 forks source link

Failed to read source code from /vercel/path0/_virtual_~icons/mdi/instagram.jsx #206

Open SSardorf opened 2 years ago

SSardorf commented 2 years ago

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)
didier commented 1 year ago

Same here. Super annoying. Have to remove node_modules and reinstall every time this happens.

didier commented 1 year ago

Should note: even that doesn't consistently fix it.

silasabbott commented 1 year ago

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.

Screen Shot 2022-08-02 at 11 34 47 PM
langlukas commented 1 year ago

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.

silasabbott commented 1 year ago

Using virtual:icons instead of ~icons to reference icons has seemed to fix it for me.

scil commented 1 year ago

I met this kind of error with webpack --watch first, then I exit webpack then execute it again, the error did not resurface again.

scil commented 1 year ago

encountered repeatly. I remove dir node_modules and tentatively remove this webpack config cacheDirectory: true.

hope it go well without this error.

AlbertoMontalesi commented 1 year ago

Any update on this? it's quite annoying, i have to delete the .next folder often to make this work.

aalyokhin commented 1 year ago

I have exactly the same issue with NextJs. 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.

  1. After opening it, finish the process with ctrl+c.
  2. Run npm run dev command, and kill it again.
  3. Repeat until getting the following result:
SCR-20230613-kudw

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.

vitalibakhur commented 11 months ago

@antfu can you fix this problem? as i see this bug very old

brian-bourdon commented 10 months ago

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

Peyman-98 commented 9 months ago

Same Problem. removing .next folder and running again will fix it. but the issue happens too much

rosslh commented 1 month ago

Still an issue in 2024. Any solutions other than disabling Next.js build caching all together?

Karakatiza666 commented 1 month ago

Same issue, been experiencing for months now