SyntaxError: missing = in const declaration
UPDATE
Bug with for...in
(for(const e in s)
)
I'm manual replace to for(let e in s)
App worked
Version
3.0.0
Reproduction link
https://codesandbox.io/s/gracious-ives-19ruu
Steps to reproduce
- create first vue app with vue-cli (vue create hello-world)
- yarn serve (nodejs 12.18.4)
- Firefox 48a2
What is expected?
I'm will get a Hello world app
What is actually happening?
I'm get a error
SyntaxError: missing = in const declaration chunk-vendor.js line 296:19
Firefox 48 can download from here: http://archive.mozilla.org/pub/firefox/nightly/2016/06/2016-06-05-00-40-13-mozilla-aurora/
With vuejs 2.x it's work in firefox 48
Hi @unbyte,
with vue@2, no any problem with FF 48a2 But with vue@3, I don't understand why.
I want to build KaiOS (FF 48a2) application with vue@3. Maybe I can't do that with vue@3
Slightly related: I can’t seem to find any statement with regards to browser support/compatibility in the Vue.js 3 documentation. Without it, how can I know whether Firefox 48 is supposed to be supported?
with vue@2, no any problem with FF 48a2 But with vue@3, I don't understand why.
sorry but I refer to this only for reference and to indicate that const itself is supported in Firefox 48
Any bug in here?
if(s)for(const e in s)t[e]=s[e]
is this fragment at line 296:19
? but const in for-in and for-of loops is supported by Firefox 48 as caniuse shows
This seems to be a bug in Firefox itself, see https://stackoverflow.com/questions/39044803/syntaxerror-missing-in-const-declaration-firefox-50 and https://bugzilla.mozilla.org/show_bug.cgi?id=1101653 for further reference. I'm currently experiencing the same issue while creating a Svelte 3.0 App with Rollup for KaiOS. The developer build throws exactly the same error, the production build runs without any issues. I don't know about Vue, but maybe creating a production build also resolves your issue.
Solved it.
I was testing my website in Firefox 48. Because I wanted my website to work in kaiOS browsers which run on firefox 48.
The packages I was using were written using ES6 syntax and firefox 48 doesn't support that. So I had to add those packages to a transpileDependencies
array in my vue.config.js
and it was working perfectly.
https://cli.vuejs.org/core-plugins/babel.html#configuration
I'm closing this issue because:
- The latest version of Vue (3.x) only supports browsers with native ES2015 support, while Firefox 48 only has partial support for ES2015. (https://vuejs.org/about/faq.html#what-browsers-does-vue-support)
- It might be possible to make it work (it's not guaranteed, though) in Firefox 48 by transpiling all the incompatible dependencies, as pointed out in previous comments. In Vue CLI, it's
transpileDependencies
; in Vite, it's@vitejs/plugin-legacy