Coding Global Background
Coding Global

wierd import error

Archiviert a year ago
2
2 Nachrichten
2 Mitglieder
a year ago
In Discord öffnen
A
𝚊𝚋𝚜𝚞𝚛𝚍𝚒𝚜𝚖
Verified

Hello, I'm new to this server and currently following a YouTube tutorial on creating a Chrome extension. I'm not sure if this is the right channel to ask, but could I get some help? https://www.youtube.com/watch?v=_IM-YT1xfUc I'm developing a Chrome extension using Vite and React, but I'm encountering the error Uncaught SyntaxError: Cannot use import statement outside a module when running the content script. My manifest.json is set to "type": "module" for the content script, and I'm using Vite to bundle the project. The vite.config.js includes the React plugin, and the build output seems to use ES module syntax. Despite this, the browser still doesn't recognize the import statements in the content script. I've ensured the manifest_version is 3 and verified the output file paths and directory structure, but the issue persists. Any ideas on what might be causing this or how to resolve it? Uncaught SyntaxError: Cannot use import statement outside a module Context https://leetcode.com/problems/two-sum/description/ Stack Trace src/content.tsx:1 (anonymous function)

Antworten (2)