Still issues with broadcast-channel dependency and svelte-kit
See original GitHub issue@amen-souissi @benmccann I tried 1.4.1
now.
We still have a problem with broadcast-channel
if I remove these lines from svelte.config.js
:
vite: {
optimizeDeps: {
include: ['broadcast-channel']
},
}
This is the log:
1:22:06 AM [vite] Error when evaluating SSR module /node_modules/broadcast-channel/dist/es/method-chooser.js:
ReferenceError: require is not defined
at eval (/node_modules/broadcast-channel/dist/es/method-chooser.js:26:20)
at instantiateModule (C:\kit\node_modules\vite\dist\node\chunks\dep-e9a16784.js:68197:166)
Do you have any idea?
Maybe this is related to "type": "module"
in package.json
which is the default in a new SvelteKit project, right?
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Getting lots of 'Failed to execute 'postMessage' on ... - Reddit
Getting lots of 'Failed to execute 'postMessage' on 'BroadcastChannel': Channel is closed' errors. Everything seems to be working ok. However, ...
Read more >broadcastQueryClient (Experimental) - Svelte Query
This utility comes packaged with svelte-query and is available under the @sveltestack/svelte-query import. However, this utility needs the broadcast-channel ...
Read more >توییتر \ James Hibbard (@jchibbard) - Twitter
In this article, Juan Diego covers the least known yet extremely useful APIs, such as the Page Visibility API, Web Sharing API, Broadcast...
Read more >Svelte I18n | internationalization Library for Svelte - Morioh
svelte-i18n helps you localize your app using the reactive tools Svelte provides. By using stores to keep track of the current locale, dictionary...
Read more >comments - Hacker News
The general issue with computer-assisted surveillance is that it is ... On top of that, cheating is still possible with readily available tools,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, I don’t think this is a window-only bug, cuz I also got this error using Ubuntu Linux. Even I tested a basic repo running in codesandbox, I still got the same error.
Here is a reproduce repo made in Code Sandbox, hope this help: https://codesandbox.io/s/svelte-query-bug-141-f0ksh
Updates: For workaround, make sure
broadcast-channel
is presented invite.optimizeDeps.include
.Hello,
A new version (v1.5.0) of this library has been published today. This version makes broadcast-channel an optional dependency. This should fix all problems with svelte-kit.
If you need to use the experimental
broadcastQueryClient
, you now need to install it manually (see: broadcastQueryClient).If you still encounter issues with v1.5.0. Please open a new issue.