I’m new to Solid and trying to implement the First Solid App tutorial in SvelteKit. I can get authentication working but trying to call
getSolidDataset from the
@inrupt/solid-client package results in the following error and stack trace:
Uncaught (in promise) ReferenceError: global is not defined stream src-DPXTNCLZ.js:1790 __require2 chunk-HTQAWXVB.js:48 stream src-DPXTNCLZ.js:2788 __require2 chunk-HTQAWXVB.js:48 <anonymous> N3Store.js:3 _stream_readable.js:48:20 parse index.es.js:1796 AsyncFunctionThrow self-hosted:696 (Async: async) parsingPromise index.es.js:2992 responseToSolidDataset index.es.js:2947 AsyncFunctionNext self-hosted:692 (Async: async) getSolidDataset index.es.js:3019 AsyncFunctionNext self-hosted:692 (Async: async) writeProfile main.js:64 <anonymous> main.js:142 (Async: EventListener.handleEvent) <anonymous> main.js:140 InnerModuleEvaluation self-hosted:2371 evaluation self-hosted:2332
From poking around it looks like it might be related to a dependency of solid-client (possibly readable-stream) only being available as CommonJS rather than ESM and that Vite (which SvelteKit is built around) can’t bundle it properly.
I’ve tried various workarounds including what’s been mentioned in Svelte and Solid but no luck so far and I’m starting to climb the walls, going around in circles.
Anybody have any experience with this and found a solution? Have you tried SvelteKit and Solid @happybeing?
Can’t wait to get over this hurdle and start creating Solid App! Thanks!