Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: process not found #54

Open
kosirm opened this issue Nov 6, 2021 · 1 comment
Open

Error: process not found #54

kosirm opened this issue Nov 6, 2021 · 1 comment

Comments

@kosirm
Copy link

kosirm commented Nov 6, 2021

I'm getting this error when trying to make index on local pouchdb (idb).

utils.js?3b7b:59 Uncaught (in promise) ReferenceError: process is not defined
    at usedCB (utils.js?3b7b:59)

Highlited function is from utils.js line 59. Any help appreciated.

I'm using pouchdb latest with quasar (vue 3), chrome latest, windows 11.

@kernelwhisperer
Copy link

It depends on the bundler you're using, with vite for example you can do:

import react from "@vitejs/plugin-react"
import { defineConfig } from "vite"

// https://vitejs.dev/config/
export default defineConfig({
  define: { global: "window", process: "window" },
  plugins: [react()],
})

And then, somewhere at the start of your app:

  <script>
    window.nextTick = (callback, ...args) => setTimeout(callback, 0, ...args)
  </script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants