Comments (11)
You are trying to use import statements in js file, which is causing issue. Also if you run pnpm dev
and load extension in chrome, it will display better error messages (with source-maps).
from vite-vue3-chrome-extension-v3.
You are trying to use import statements in js file, which is causing issue. Also if you run
pnpm dev
and load extension in chrome, it will display better error messages (with source-maps).
If I run pnpm dev I don't see any error message, my script works fine but after build it prompts this error, I don't know why this is happening.
from vite-vue3-chrome-extension-v3.
You are using imports inside a js file, which I believe gets transpiled during dev process. But when using build it is not processed therefore this error. Consider using npm pakcage for the ajax-hook
from vite-vue3-chrome-extension-v3.
I started out using npm, but I switched to importing js when I got this error 'ajax-hook' is imported by src/content-script/inject.ts, but could not be resolved – treating it as an external dependencyYou are using imports inside a js file, which I believe gets transpiled during dev process. But when using build it is not processed therefore this error. Consider using npm pakcage for the
ajax-hook
from vite-vue3-chrome-extension-v3.
Did you add package?
pnpm add ajax-hook
and then
pnpm i
from vite-vue3-chrome-extension-v3.
Did you add package?你添加了包吗?
pnpm add ajax-hookand then 进而
pnpm i
I of course ran the command to add the dependency and this is my package.json
{
"dependencies": {
"ajax-hook": "^3.0.1",
"vue": "^3.3.4",
"vue-router": "^4.2.4"
},
"devDependencies": {
"@crxjs/vite-plugin": "^2.0.0-beta.18",
"@iconify-json/mdi": "^1.1.54",
"@tailwindcss/forms": "^0.5.4",
"@types/chrome": "^0.0.243",
"@types/eslint": "^8.44.2",
"@types/eslint-config-prettier": "^6.11.0",
"@types/node": "^18.17.3",
"@types/prettier": "^3.0.0",
"@typescript-eslint/eslint-plugin": "^6.3.0",
"@typescript-eslint/parser": "^6.3.0",
"@vitejs/plugin-vue": "^4.2.3",
"@vue/compiler-sfc": "^3.3.4",
"@vueuse/core": "^10.3.0",
"autoprefixer": "^10.4.14",
"eslint": "^8.46.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-vue": "^9.16.1",
"postcss": "^8.4.27",
"prettier": "^3.0.1",
"prettier-plugin-tailwindcss": "^0.4.1",
"sass": "^1.64.2",
"tailwindcss": "^3.3.3",
"typescript": "^5.1.6",
"unplugin-auto-import": "^0.16.6",
"unplugin-icons": "^0.16.5",
"unplugin-vue-components": "^0.25.1",
"vite": "^4.4.9",
"vite-plugin-pages": "^0.31.0",
"vue-tsc": "^1.8.8",
"webext-bridge": "^6.0.1"
},
"name": "vite-vue3-chrome-extension-v3",
"overrides": {
"@crxjs/vite-plugin": "$@crxjs/vite-plugin"
},
"pnpm": {
"overrides": {},
"peerDependencyRules": {
"allowAny": [],
"allowedDeprecatedVersions": {
"sourcemap-codec": "1.4.8"
},
"allowedVersions": {},
"ignoreMissing": []
}
},
"private": true,
"scripts": {
"build": "vite build",
"dev": "vite",
"lint": "eslint . --fix --ext js,mjs,cjs,ts,mts,cts,vue",
"preview": "vite preview"
},
"type": "module",
"version": "0.0.1"
}
The above error still exists and I'm struggling with it 🥺
from vite-vue3-chrome-extension-v3.
Can you help me look at it, I've been struggling with it for days and still no solution, google can't find an answer, thank you!
from vite-vue3-chrome-extension-v3.
I will check it, pls update repo to use npm package of ajax-hook
from vite-vue3-chrome-extension-v3.
I will check it, pls update repo to use npm package of ajax-hook
I've updated the repository, please check it for me if you have time, thanks again!
from vite-vue3-chrome-extension-v3.
- You can inject scripts using
manifest.config.js
OR - you can import scripts into content script,
vite
will process these too.
from vite-vue3-chrome-extension-v3.
from vite-vue3-chrome-extension-v3.
Related Issues (20)
- I want to use vue-18n in this project. However there is an error. Can you give me some solution? HOT 1
- Chrome V3 Refused to execute inline script ... HOT 1
- Question: image paths inside vue components HOT 1
- [Feature] Add on install webpage example
- [Feature] Add DaisyUI
- content-script does not use iframe, style issue HOT 2
- How do I quickly apply changes from this repository to my plugin? HOT 1
- When my plugin opens a local html page, it can't find the js file in the same directory as the page? HOT 7
- [Feature] Add offscreen document sample
- [Feature] Support live reload for Install & Update pages
- Scripts should use `module` type
- [TODO] migrate to unplugin-vue-router
- [Feature] Add tailwind prettier plugin class support
- [Feature] Add oxc plugin for vscode
- Add Prefix To Isolate Source Website And Our Plugin HOT 7
- Switch to chrome-types
- Add vue devtools vite plugin HOT 12
- Global error handling to avoid extension context issues HOT 1
- Source files (.ts) in dist folder HOT 7
- TODO Update to Vite 5 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vite-vue3-chrome-extension-v3.