OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

PouchDB and SvelteKit

  • Thread starter Thread starter Martin Weissenboeck
  • Start date Start date
M

Martin Weissenboeck

Guest
I want to use PouchDB with SvelteKit. I have copied pouchdb-7.2.1.js to /src/libd 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):

Code:
<script context="module">
    export const ssr = false;
</script>

<script>
    import PouchDB from '$lib/pouchdb.js'; 
</script>

I get an error 500

Code:
import not found: PouchDB

I have tried a lot of diffent version without any success. For example:

Code:
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?

<p>I want to use PouchDB with SvelteKit. I have copied pouchdb-7.2.1.js to <code>/src/lib</code>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):</p>
<pre><code><script context="module">
export const ssr = false;
</script>

<script>
import PouchDB from '$lib/pouchdb.js';
</script>
</code></pre>
<p>I get an error 500</p>
<pre><code>import not found: PouchDB
</code></pre>
<p>I have tried a lot of diffent version without any success. For example:</p>
<pre><code>import PouchDB from 'pouchdb-browser'; (After npm i pouchdb-browser)
import PouchDB from 'pouchdb'; (After npm i pouchdb)
</code></pre>
<p>What is the correct way to use pouchdb?</p>
 

Latest posts

M
Replies
0
Views
1
MOHAMED AMIIN ABDI AADAN
M
Top