-
-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vite+Solid and lucide-solid, Loading failed for the module #1675
Comments
Hi @krishna-santosh, So sorry to hear you've run into an issue, however, I've followed the steps and I'm unfortunately unable to reproduce this issue. |
Hello @karsa-mistmere Here's a Stackblitz Preview of the bug https://stackblitz.com/edit/solidjs-templates-gbewty?file=src%2FApp.tsx |
Thanks for the stackblitz, uncommenting |
After Uncommenting that line and restarting the server, its just blank. ls1.mp4 |
@karsa-mistmere @jguddas Have you had a chance to run this on a Linux machine? because, I just tried the stackblitz link on my windows 11 machine, it works fine, I guess the problem is with my Arch Linux machine |
This is the error that I get in firefox console on Linux, There's no error in chromium and brave, they just freeze with a blank white screen, even the right click doesn't work. |
I don't currently have Linux. Can you check if you also get this error with other browsers on Arch Linux. And just to clarify, you do also experience this issue on Linux with the stackblitz link, right? |
Yes, I get the same error on chromium, brave, and firefox on my Arch machine. Yes, same problem with the stackblitz link on Linux. |
Just to clarify, this is the error you get on stackblitz? Why would that be looking for localhost:5173? |
That is not on stackblitz, that's when I create and run the project locally on my machine. and that too only in firefox I see that message, there's nothing in chromium and brave browser's console. |
And what error do you get on stackblitz if any? |
No, I don't see any errors on stackblitz |
Possibly related to solidjs/solid-start#1112 |
@jguddas Have you encountered a similar error in Firefox as I did? |
In Linux+Firefox, I get a bunch of very similar errors and a blank page.
|
Edit: Make sure that you don't have any extensions that can block resources during development. In my case uBlock origin was blocking one of the icon chunks. After disabling uBlock it works without any issue. |
I disabled every extension and even tried incognito mode. Blank page, infinite loading, and after a while it crashes the tab ,with no error on console. It's really sad, seemed like a good icon lib, unfortunately it doesn't work at all. |
@dinnymate can you post the version lucide-solid and the version of solid you used. Maybe it is a new issue |
I tried with lucide-solid 0.321.0 and solidjs 1.8.12 and 1.7.12 as well. But the stackblitz above does not work either. Although it might really be a different issue 'cause for me, just importing the icon also breaks everything both locally and stackblitz. |
@ericfennis actually I don't have any extensions either, but still it won't work as I mentioned in the conversation above. It would be better if we reopen this issue. |
I'm experiencing the same problem on my Arch (Manjaro) machine. Brave and Chromium will not load the SolidJS app (blank screen, infinite page load or sometimes "Page Unresponsive"). Firefox will load the app, but it's slow to load. The minimum repeatable steps for me are,
In the Network tab in all three browsers I can see ~1400 lucide icons get loaded on connecting to the app, even though only a single icon is imported (this is probably expected behaviour I think - tree shaking happens at build time). Serving the built app (after I just had an idea that it was solid devtools, but I uninstalled the I tried starting up the app in dev mode with the Lucide import commented out and everything loaded perfectly. I then uncommented the Lucide import line and saved the file and I could see in the Network tab of both browsers that the individual icons were requested. Firefox successfully loaded all icons and the app reloaded fine. In Chromium, the last third of the icons were stuck in the "pending" status, from solid-js: 1.8.11 |
Weird but I also have Arch Manjaro and I can't use Lucide in my Solid project:
It seems Vite is not transpiling the TypeScript file that imports
|
Hi @stav & @stefanadelbert, can you please check if v0.354.0 resolves your issues? |
@karsa-mistmere It works! |
Apologies for not trying this out sooner. @karsa-mistmere I've just tried with v0.354.0 and v0.358.0, but I'm getting the same behaviour as before, i.e. the problem doesn't appear to be fixed in the latest version. |
I'm reopening this since it's not yet been resolved. |
For me, the problem was my adblocker. Turning that off for my localhost, made it work. |
Turning off adblock also fixes the issue for me, but why is this the case? and will this also affect production? |
Making Alternatively, copying and just importing the used svgs also works. |
https://christopher.engineering/en/blog/lucide-icons-with-vite-dev-server/ fixes issue that Solid would just render blank page when uBlock blocks fingerprint.jsx icon: lucide-icons/lucide#1675 (comment)
disabling ublock works |
This is happening with Firefox on Linux. Disabling adblock doesn't do it for me, and this is happening in dev server as well. During my investigation, I found that all the icons in node_modules use a generic dynamic Icon component, which the documentation discourages. I'm not sure if this is the root cause but wanted to highlight it in case anyone has insights. |
I just realized the link @vogler provided better approach by just directly importing the icons. This does resolved my issue. (Still in dev server, with adblock on) Maybe consider this approach for the library? Here's my changes to get mine working // Add a node_modules alias to vite config
resolve: {
alias: {
'lucide-solid/icons': path.resolve(__dirname, './node_modules/lucide-solid/dist/source/icons'),
},
}, // import the icon
import Trash2 from 'lucide-solid/icons/trash-2' |
Hey @dnswd, I'm afraid this is a misunderstanding – what the documentation actually advises against is importing all icons in your code, because then tree-shaking is kaput and your build size goes 📈. Using a single generic icon component is fine, as long as you:
|
I think I know what's going on here. Ad blockers such as uBlock and AdBlock try to prevent the loading of tracking scripts, which may include a "fingerprinting" module such as https://fingerprint.com/. Ad blockers see the keyword "fingerprint", which in this case is simply a reference the lucide Fingerprint icon, and assume that this is a fingerprinting script, rather than a literal SVG in the shape of a human fingerprint. As a result, blockers may attempt to disable Javascript on the page or block requests sent to that fingerprint script origin, which causes the app to fail. Apps built using other JS frameworks may not run into this issue because... they do one of both of these things:
I need to verify that this is what's going on, but assuming that this is the case, here are two possible solutions:
|
I've closed this original issue, should be fixed by #2375. See findings in the PR description. The fingerprint issue seems another issue. @warrenbhw Lol, that's kinda funny, and a good find. |
@ericfennis I think the fingerprint issue can happen outside of dev, but need to verify. I think it usually only shows up in dev because most apps aren't using the Fingerprint icon, so it gets tree-shaken in prod. But depending on bundler/server config, I think you could hit this in prod if you're actually using the Fingerprint icon in your app. I've created a new issue to track this: #2398 Keen to hear your thoughts! |
Package
Version
0.292.0
Browser
Operating system
Description
Using Vite+Solid(TS)
dev server starts but the webpage doesn't load, Its just blank, no errors in the terminal.
Got this in firefox console when running the dev server.
When I build it with
pnpm build
andpnpm preview
It works fine. Page loads without any issue.Steps to reproduce
pnpm create vite@latest
(and choose solid with TS)pnpm install lucide-solid
Ex:
pnpm dev
http://localhost:5173
in the browserChecklist
The text was updated successfully, but these errors were encountered: