sveltekit-flash-message icon indicating copy to clipboard operation
sveltekit-flash-message copied to clipboard

Could not resolve "esm-env"

Open myftija opened this issue 1 year ago • 1 comments

Hi, I am getting an error in the build about Vite not being able to resolve esm-env, which is used by sveltekit-flash-message.

Here is the error message:

✘ [ERROR] Could not resolve "esm-env"
    ../../node_modules/.store/sveltekit-flash-message-virtual-b0a0b5868a/node_modules/sveltekit-flash-message/dist/client.js:3:35:
      3 │ import { BROWSER as browser } from 'esm-env';
        ╵                                    ~~~~~~~~~
You can mark the path "esm-env" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.

Vite version: 5.4.0 sveltekit-flash-message version: 2.4.4 SvelteKit version: 2.5.10

I wasn't able to find a workaround. Any clues what could be the issue?

myftija avatar Aug 11 '24 10:08 myftija

Usually fixed by deleting node_modules, updating packages and restarting VS Code/dev server.

ciscoheat avatar Jan 23 '25 11:01 ciscoheat