Closed Feroks closed 7 months ago
Since you are importing SQLocal in the component, you need to make sure that the component is not rendered on the server. SQLocal is only designed to run on the client. You can fix this by adding this to +layout.ts
:
export const ssr = false;
Or if it better fits your use-case, you could alternatively use a dynamic import inside of onMount
to import SQLocal or a lib file that imports it:
const { SQLocalKysely } = await import('sqlocal/kysely');
I am using latest SvelteKit version (2.0.6), which uses
bundler
moduleResolution. When i try to build or runvite dev
on my project i am getting following error:I have created repository that reproduces issue when you run
dev
command. Unlike my actual project,build
command seems to be working. Any ideas how to solve it?