-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
ReferenceError: Cannot access uninitialized variable
on Safari
#2889
Comments
I can't reproduce this in Safari 15.1. Is it still occurring? |
@Rich-Harris Thanks for checking in, I haven't been able to reproduce it anytime recently, likely due to some third-party library that interfered with SSR. |
cool — will close this, feel free to open a new issue with repro if you encounter it again. thanks |
@Rich-Harris This is occurring for me in Safari when trying to access dynamic routes. Let me know if you need more information about my project. Edit: Safari Version 15.6 |
+1 I'm also having this issue (Safari 16.1), it only happens while running in dev and not in any builds. No issues on chrome, no idea what's causing it yet. |
@segovo @brittianwarner if you are still experiencing this issue, please open a new issue with a reproduction |
@geoffrich No problem, #8529 |
@Rich-Harris @pheuter We finally resolved this issue by removing the esnext build target in our vite config, which was there for a couple of top-level awaits. This bug in webkit is what ultimately made us try this update. Hoping this helps someone that is currently telling everyone, "Safari is the new IE" :). |
@brittianwarner could you help to explain more on the action? Please. |
Just in case anybody else is stumbling upon this issue—opening the Tauri app in Chrome under port 5173 (or whatever port you have configured) enabled me to solve the issue. It turns out that I had variables that were accessed before declaration, and the details in Chrome were far more detailed (for some reason Safari gives cryptic errors). When you open this in Chrome, you should see
and you can address it appropriately. Had this issue many times and this has always been the fix. It seems like others in this issue are facing other issues, however. |
we just started experiencing this bug when upgrading to SvelteKit 2. worked fine before, now its breaking only in safari (16.5 for me) on line 12 in exports.js: function validate(module, file) {
if (!module) return;
for (const key in module) {
if (key[0] === '_' || expected.has(key)) continue; // key is valid in this module
const values = [. im trying to repro in a standalone environment, but currently having trouble. Either way we cannot upgrade to v2 right now as it breaks all Safari usage. Would appreciate any help you guys may have! |
@thesiti92 Are you using any top level awaits? I don't think v2 supports top level awaits but this was my issue a while ago. Try spinning up a clean v2 project and see if it is still happening and you can at least narrow it down to something unique about your project. I worked through this a while ago and the best thing to do is try to follow best practices. |
I opened a new ticket, seems to be something with the sveltekit 2 runtime #11364 |
Describe the bug
Running Svelte Kit app using
> svelte-kit dev --port 3001
works in Chrome but throws the following error only in Safari:Issue is in
async _load_node({ status, error, module, page, stuff }) {}
in .svelte-kit/dev/runtime/internal/start.jsFor some reason, Safari doesn't like the fact that the variable is named
module
and further thinks it's undefined?Reproduction
Any svelte-kit boilerplate.
Logs
No response
System Info
Severity
blocking all usage of SvelteKit
Additional Information
The text was updated successfully, but these errors were encountered: