I am creating a Chrome Extension. In the popup.js, I want to add a third party javascript library. (For reference let's say "uuid").
My end goal is to import a internal library, (and not uuid). I have used uuid for simplicity, my use case is much more complex. Manifest version is 3, and I don't want this behaviour through content script or background script. I only need it for chrome page's popup.html javascript file popup.js.
When I am using the syntax
import { v4 as uuidv4 } from "uuid";
I get an error saying
Uncaught TypeError: Failed to resolve module specifier "uuid". Relative references must start with either "/", "./", or "../".
If I import it by using
import { v4 as uuidv4 } from "../node_modules/uuid";
I get the error saying
Failed to load resource: net::ERR_FILE_NOT_FOUND