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

Vite ErrorOverlay TypeError #9010

Closed
navtoj opened this issue Feb 12, 2023 · 3 comments · Fixed by #9440
Closed

Vite ErrorOverlay TypeError #9010

navtoj opened this issue Feb 12, 2023 · 3 comments · Fixed by #9440

Comments

@navtoj
Copy link

navtoj commented Feb 12, 2023

Describe the bug

The below error shows up in the browser console when I start the vite dev server with npm run dev.

image

Reproduction

It only happens sometimes so I'm not sure how to replicate it.

Logs

overlay.ts:152 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'replace')
    at new ErrorOverlay (overlay.ts:152:21)
    at createErrorOverlay (client.ts:278:29)
    at handleMessage (client.ts:247:9)
    at WebSocket.<anonymous> (client.ts:91:5)
ErrorOverlay @ overlay.ts:152
createErrorOverlay @ client.ts:278
handleMessage @ client.ts:247
(anonymous) @ client.ts:91

System Info

System:
  OS: macOS 12.6.3
  CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Memory: 66.80 MB / 16.00 GB
  Shell: 5.8.1 - /bin/zsh
Binaries:
  Node: 19.2.0 - /usr/local/bin/node
  npm: 8.19.3 - /usr/local/bin/npm
npmPackages:
  @sveltejs/adapter-cloudflare: ^1.0.0 => 1.1.0 
  @sveltejs/kit: ^1.0.0 => 1.3.9 
  svelte: ^3.54.0 => 3.55.1 
  vite: ^4.0.0 => 4.0.4

Severity

annoyance

Additional Information

Would this error stop the vite error overlay from showing up when some error happens in sveltekit?

@navtoj navtoj changed the title vite ErrorOverlay Vite ErrorOverlay TypeError Feb 12, 2023
@gtm-nayan
Copy link
Contributor

gtm-nayan commented Feb 12, 2023

@navtoj put a breakpoint on that line the and check what the original error message was if it happens again. There aren't many that'd have a code frame but omit the message so it's hard to think of a repro.

@Rich-Harris
Copy link
Member

I experienced this today, but it was fleeting. Presumably somewhere a non-Error is being thrown

@Rich-Harris
Copy link
Member

figured it out: #9440

benmccann added a commit that referenced this issue Mar 17, 2023
dummdidumm pushed a commit that referenced this issue Mar 29, 2023
fixes #9010

---------

Co-authored-by: Rich Harris <git@rich-harris.dev>
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants