Comments (7)
I don't quite understand the error behind. But I played around a bit, manually importing import browser from 'webextension-polyfill'
in Popup.vue
or updating the auto import config 'webextension-polyfill': [ ['*', 'browser'], ],
to 'webextension-polyfill': [ ['default', 'browser'], ],
seems to fix the undefined error
from vitesse-webext.
updating the auto import config 'webextension-polyfill': [ ['*', 'browser'], ],
to 'webextension-polyfill': [ ['default', 'browser'], ],
works in dev, but breaks in production.
it seems like a bug in the unplugin-auto-import (not sure), PRs welcome :)
from vitesse-webext.
I have another problem. After updating
"webextension-polyfill": [["*", "browser"]],
to"webextension-polyfill": [["default", "browser"]],
, it can run without error, but the type prompt forbrowser
is no longer available.
I restored "webextension-polyfill": [["default", "browser"]],
to "webextension-polyfill": [["*", "browser"]],
, then add import browser from "webextension-polyfill"
in Popup.vue
, it works.
But I'm not sure if this is correct, hope there is a better solution.
from vitesse-webext.
hi @tmkx thanks for following up. It does look like a limitation of unplugin-auto-import.
Based on the generated code from unplugin-auto-import, when 'webextension-polyfill': [ ['*', 'browser'] ]
is configured, the Browser type is generated correctly (however, the browser object imported is not - the actual browser alias needed is in fact browser.default
, and thus the reason browser.runtime
is undefined). Likewise, if 'webextension-polyfill': [ ['default', 'browser'] ]
is used, the imported object is correct (while Browser type is not).
from vitesse-webext.
updating the auto import config
'webextension-polyfill': [ ['*', 'browser'], ],
to'webextension-polyfill': [ ['default', 'browser'], ],
works in dev, but breaks in production.it seems like a bug in the unplugin-auto-import (not sure), PRs welcome :)
That works for me
from vitesse-webext.
updating the auto import config
'webextension-polyfill': [ ['*', 'browser'], ],
to'webextension-polyfill': [ ['default', 'browser'], ],
works in dev, but breaks in production.
it seems like a bug in the unplugin-auto-import (not sure), PRs welcome :)That works for me
me too
from vitesse-webext.
I have another problem.
After updating "webextension-polyfill": [["*", "browser"]],
to "webextension-polyfill": [["default", "browser"]],
, it can run without error, but the type prompt for browser
is no longer available.
from vitesse-webext.
Related Issues (20)
- Vite server did not start HOT 3
- The options page will display an error after using vue-i18n HOT 3
- Fix HMR in contentScript App by using an iframe HOT 1
- React port of Vitesse-webext HOT 1
- insecure sources are not allowed in content_security_policy.extension_pages (Firefox) HOT 1
- community version that supports Manifest V3 HOT 2
- [webext-bridge] No handler registered in 'content-script' to accept messages with id 'get-name' HOT 1
- Vue.js not detected by Vue dev tools HOT 1
- Why new tab 'Document' is opened on startup? HOT 1
- Vite Server did not start - error when zipping and trying on another pc HOT 1
- Invalid assets URL in dev mode HOT 5
- e2e basic tests fails HOT 2
- Reactive storage infinite loop caused by race conditions HOT 2
- element-plus styles lose HOT 8
- Popup & Option doesn't work when after build. HOT 3
- Vite server did not start HOT 1
- docs: update components README plugin name and link HOT 1
- Sidepanel example HOT 5
- How to change the element plus class namespace HOT 8
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 vitesse-webext.