floating-ui / svelte-popper

🍿🔗Official Svelte wrapper for Popper - the positioning library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Example code does not work in Svelte REPL

i8ramin opened this issue · comments

This seems related to the usage of process.env, but when you try to run the example/demo code in the Svelte REPL, it fails. Here is an example:

https://svelte.dev/repl/1939e8c1af6641a7a0f4adf45134093a?version=3.32.1

Error:

Error: Uncaught (in promise): process is not defined

Is there a way to tell this library to use the dist/esm variant as described here https://popper.js.org/docs/v2/#distribution-targets

Note: adding this line before import Popper from "@popperjs/svelte" seems to fix it in the REPL:

window.process = {env: {}}