Installing Svench breaks SvelteKit app
bootsa opened this issue · comments
Hi,
I know that SvelteKit integration is still on the "roadmap".
I managed to get Svench working in my SvelteKit app (supporting path aliasing using #29#issuecomment-850002113) but then trying to start up the base SvelteKit app using npm run dev
I get an error.
Pre-bundling dependencies:
svelte/store
svelte
svelte/transition
svelte/motion
svelte/animate
(...and 18 more)
(this will be run only when your dependencies or config have changed)
> node_modules/cheap-watch/dist/CheapWatch.esm.js:1:9: error: No matching export in "browser-external:events" for import "EventEmitter"
1 │ import { EventEmitter } from 'events';
╵ ~~~~~~~~~~~~
> node_modules/cheap-watch/dist/CheapWatch.esm.js:3:9: error: No matching export in "browser-external:util" for import "promisify"
3 │ import { promisify } from 'util';
╵ ~~~~~~~~~
> Build failed with 2 errors:
node_modules/cheap-watch/dist/CheapWatch.esm.js:1:9: error: No matching export in "browser-external:events" for import "EventEmitter"
node_modules/cheap-watch/dist/CheapWatch.esm.js:3:9: error: No matching export in "browser-external:util" for import "promisify"
Error: Build failed with 2 errors:
node_modules/cheap-watch/dist/CheapWatch.esm.js:1:9: error: No matching export in "browser-external:events" for import "EventEmitter"
node_modules/cheap-watch/dist/CheapWatch.esm.js:3:9: error: No matching export in "browser-external:util" for import "promisify"
at failureErrorWithLog (/store/BOOTSA/dev/playground/test-sveltekit-svench/node_modules/esbuild/lib/main.js:1493:15)
at /store/BOOTSA/dev/playground/test-sveltekit-svench/node_modules/esbuild/lib/main.js:1151:28
at runOnEndCallbacks (/store/BOOTSA/dev/playground/test-sveltekit-svench/node_modules/esbuild/lib/main.js:941:63)
at buildResponseToResult (/store/BOOTSA/dev/playground/test-sveltekit-svench/node_modules/esbuild/lib/main.js:1149:7)
at /store/BOOTSA/dev/playground/test-sveltekit-svench/node_modules/esbuild/lib/main.js:1258:14
at /store/BOOTSA/dev/playground/test-sveltekit-svench/node_modules/esbuild/lib/main.js:629:9
at handleIncomingPacket (/store/BOOTSA/dev/playground/test-sveltekit-svench/node_modules/esbuild/lib/main.js:726:9)
at Socket.readFromStdout (/store/BOOTSA/dev/playground/test-sveltekit-svench/node_modules/esbuild/lib/main.js:596:7)
at Socket.emit (node:events:365:28)
at Socket.emit (node:domain:470:12)
I've put together a test repo that demonstrates this (it's just the SvelteKit demo project with Svench added).
Don't quite understand why installing Svench (that seems to run pretty much in isolation from the rest of the SvelteKit site) should break the SvelteKit site yet Svench runs fine.
I've tested locally & using gitpod, & tried with npm & pnpm - all with the same result.
Would really love to get this up and running for our next project as it seems a great way to document and test components.
See solution in #45
Thanks a lot, fixed it perfectly.
Missed that issue - guess I was in the sweet spot between it being closed & the take being updated. Lesson learned - always look through close issues too!