I want to use PouchDB with SvelteKit. I have copied pouchdb-7.2.1.js to /src/lib
d in SvelteKit and renamed it to pouchdb.js. Pouchdb should run in the browser. Therefore I have used ssr=false to suppress server side rendering. I get the first error at the import statement. This is my first very short page (couchdb.svelte):
<script context="module">
export const ssr = false;
</script>
<script>
import PouchDB from '$lib/pouchdb.js';
</script>
I get an error 500
import not found: PouchDB
I have tried a lot of diffent version without any success. For example:
import PouchDB from 'pouchdb-browser'; (After npm i pouchdb-browser)
import PouchDB from 'pouchdb'; (After npm i pouchdb)
What is the correct way to use pouchdb?
npm i pouchdb-browser
,npm i pouch-adapter-memory
, and just used e.g.import PouchDB from "pouchdb-browser"
. Looked ok but am getting the dreaded "global is not defined". Likely related to some global/globalThis madness (I am not familiar with svelte). I should think npm should just work. – RamblinRose