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

broadcast-channel required in sapper/webpack build #73

Open
vboulaye opened this issue Feb 1, 2022 · 0 comments
Open

broadcast-channel required in sapper/webpack build #73

vboulaye opened this issue Feb 1, 2022 · 0 comments

Comments

@vboulaye
Copy link

vboulaye commented Feb 1, 2022

Hi,

I have a project using sapper + webpack and svelte-query in version 1.4.1 which works fine.

I tried to upgrade svelte-query to 1.6.0 but it does not build anymore.

I reproduced the issue by starting a new project from the sapper template and just adding the QueryClient in _layout.svelte

When I npm run build I get:

ERROR in ./node_modules/@sveltestack/svelte-query/svelte/queryCore/broadcastQueryClient-experimental/index.js
Module not found: Error: Can't resolve 'broadcast-channel' in '/home/uvba7442/dev/misc/svelte-query-test/node_modules/@sveltestack/svelte-query/svelte/queryCore/broadcastQueryClient-experimental'
 @ ./node_modules/@sveltestack/svelte-query/svelte/queryCore/broadcastQueryClient-experimental/index.js 3:39-66
 @ ./node_modules/@sveltestack/svelte-query/svelte/queryCore/index.js
 @ ./node_modules/@sveltestack/svelte-query/svelte/index.js
 @ ./src/routes/_layout.svelte
 @ ./src/node_modules/@sapper/internal/manifest-client.mjs
 @ ./src/node_modules/@sapper/app.mjs
 @ ./src/client.js
> Encountered errors while building app

if I npm add broadcast-channel I get errors like Error: Can't resolve 'fs' in '/.../node_modules/broadcast-channel/dist/esnode/methods' instead.

I suppose that I am missing something in the webpack config, but maybe I should rather migrate to svelte-kit instead ?

Is there something to do in the build config to make it ignore the BroadcastQueryClient when it is not used ?

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

No branches or pull requests

1 participant