antony / sveltekit-adapter-browser-extension

Build browser extensions with Svelte (early prototype)
161 stars 19 forks source link

Cannot handle imports of external modules in background.js scripts #20

Open gprieto opened 2 years ago

gprieto commented 2 years ago

When background.js script contains external module imports like:

import { Client } from '@notionhq/client';

I get the following error while trying to load the extension in Chrome:

Service worker registration failed
Uncaught TypeError: Failed to resolve module specifier "@notionhq/client". Relative references must start with either "/", "./", or "../".