Subscribe on changes!

Unable to use Vue 3 with Chrome extensions.

avatar
Nov 9th 2021

Version

3.2.21

Reproduction link

https://impossible.com/

Steps to reproduce

I'm trying to create browser extension with manifest v3 and use Vue 3 inside popup of the extension. But 'unsafe-eval' is not allowed, and I'm getting an error:

Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".

at new Function (<anonymous>)
at compileToFunction (vue.js:15497)
at finishComponentSetup (vue.js:7834)
at setupStatefulComponent (vue.js:7769)
at setupComponent (vue.js:7699)
at mountComponent (vue.js:5564)
at processComponent (vue.js:5539)
at patch (vue.js:5145)
at render (vue.js:6283)
at mount (vue.js:4664)

What is expected?

The application should work

What is actually happening?

Application is failed with exception


I used Vue 2 with manifest v2 for many years. It will be good to figure out some solution for this problem.

avatar
Nov 9th 2021

Hi, thanks for your interest but Github issues are for bug reports and feature requests only. You can ask questions on the forum, the Discord server or StackOverflow.


Here you have a nice template: https://github.com/antfu/vitesse-webext