I’m trying to run a piece of JavaScript code written in a tutorial that looks like this:
main.js
JavaScript
x
9
1
import Vue from 'Vue';
2
import Alert from './components/Alert.vue';
3
4
new Vue({
5
el: 'body',
6
7
components: { Alert }
8
})
9
However, PhpStorm is giving the following error:
Import declarations are not supported by current JavaScript version
How I can get a newer(?) JavaScript version in PhpStorm? Is that really the problem here?
Advertisement
Answer
In your preferences, change the version of javascript to ECMAScript 6.