Skip to content
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

Hovering on a link with sveltekit:prefetch before JS loads throws an error on console #683

Closed
pablo-abc opened this issue Mar 25, 2021 · 2 comments
Labels
bug Something isn't working prefetch router

Comments

@pablo-abc
Copy link

Describe the bug
This might be related to the fix for #652 (in #654) which is working now. If the user has a slow connection and hovers on a link with the attribute sveltekit:prefetch before JS finishes loading, SvelteKit will throw multiple times the same error TypeError: can't access property "parse", this.router is null until it finishes loading. This does not seem to break anything else and the page keeps working.

Logs

Uncaught (in promise) TypeError: can't access property "parse", this.router is null
    prefetch http://localhost:3000/.svelte/dev/runtime/internal/start.js:482
    trigger_prefetch http://localhost:3000/.svelte/dev/runtime/internal/start.js:341
    mousemove_timeout http://localhost:3000/.svelte/dev/runtime/internal/start.js:352
    setTimeout handler*handle_mousemove http://localhost:3000/.svelte/dev/runtime/internal/start.js:351
    Renderer http://localhost:3000/.svelte/dev/runtime/internal/start.js:357
    start http://localhost:3000/.svelte/dev/runtime/internal/start.js:804
    <anonymous> http://localhost:3000/:138

To Reproduce
Set throttling in your browser to "Regular 2G" or something slow enough. Load the page and before the JS finishes loading, hover a link with sveltekit:prefetch. This should throw the above error in the console.

Expected behavior
No errors in console

Stacktraces
No stack trace

Information about your SvelteKit Installation:

 System:
    OS: macOS 11.2.3
    CPU: (8) x64 Apple M1
    Memory: 98.43 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.16.0 - ~/.volta/tools/image/node/14.16.0/bin/node
    Yarn: 1.22.10 - ~/.volta/tools/image/yarn/1.22.10/bin/yarn
    npm: 7.5.4 - ~/.volta/tools/image/npm/7.5.4/bin/npm
  Browsers:
    Chrome: 89.0.4389.90
    Firefox Developer Edition: 87.0
    Safari: 14.0.3
  npmPackages:
    @sveltejs/kit: 1.0.0-next.58 => 1.0.0-next.58
    svelte: ^3.0.0 => 3.35.0
  • Tested in Firefox Developer Edition 87.0

  • Adapter: static

Severity
Just annoying, doesn't seem to be breaking anything else at all (that I have noticed).

Additional context
N/A

@pablo-abc
Copy link
Author

Fixed in #685

@benmccann benmccann added bug Something isn't working router labels Mar 26, 2021
@pablo-abc
Copy link
Author

I'm closing this seems it seems to have been fixed in #766 and I'm not having this issue anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working prefetch router
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants