-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
When any component is blocked by an Ad Blocker all functionallity is killed #10118
Comments
I don't see how SvelteKit should be able to recover from any of this. If a JavaScript file is blocked from executing that is needed for the site to function, it will obviously crash in unexpected ways. What are you imagining should happen in such a case? |
It would be nice if it could fail silently. Components like this are optional, and I'm fine with them not executing at all. But even in cases where I do want component to execute, there are going to be cases where Adblockers falsely flag a particular file. The entire site not working because of that is just not a viable outcome. Adblockers are very present and used by a large enough portion of users that we can't realistically just ignore them. |
How should Svelte(Kit) know that components "like this" are optional? We can't know, and safeguarding every possible import to fail within the code isn't practical either. In general, in situations like this it's best to try to architect the site in such a way that it also works without JavaScript so that things like this aren't that impactful. |
I use uBlock Origin on Chromium, but it blocks nothing on both stackblitz and localhost. I suppose, a dynamic import and |
Here's a thought. The files are blocked purely based on the filename. What if there was a parameter that could be toggled to randomize the filenames for each component, setting them to random strings? |
Describe the bug
When any component is blocked by an Ad Blocker the whole site crashes and any functionality seizes to function. The error reads
TypeError: error loading dynamically imported module
.I am using uBlock Origin on FireFox and Chrome. We've had other reports from this happening using AdBlock on Chrome. On Safari the issue seemed to be more muted, with the site still functioning despite the components being blocked as expected, but I was not able to confirm this myself.
Additionally in our project the page begins to redirect infinitely to itself, causing a constant looping reload. I could however not reproduce this in a clean project, but I thought it was worth noting.
Reproduction
-
and+
buttons.Here is an example of a completely clean project, there is nothing new in there except for the
ExternalAd.svelte
componenthttps://stackblitz.com/edit/sveltejs-kit-template-default-1rvavc?file=src%2Froutes%2F%2Blayout.svelte
I tested it locally as well, and the same happens as on the StackBlitz page.
Logs
System Info
Severity
blocking all usage of SvelteKit
Additional Information
This issue might be related; #2699
The text was updated successfully, but these errors were encountered: