Open vboulaye opened 2 years ago
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
QueryClient
_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.
npm add broadcast-channel
Error: Can't resolve 'fs' in '/.../node_modules/broadcast-channel/dist/esnode/methods'
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 ?
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:
if I
npm add broadcast-channel
I get errors likeError: 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 ?