Import not working with JavaScript in PhpStorm/Webstorm

JavascriptEcmascript 6PhpstormWebstorm

Javascript Problem Overview


I'm trying to run a piece of JavaScript code written in a tutorial that looks like this:

main.js

import Vue from 'Vue';
import Alert from './components/Alert.vue';

new Vue({
    el: 'body',

    components: { Alert }
})

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?

Javascript Solutions


Solution 1 - Javascript

In your preferences, change the version of javascript to ECMAScript 6.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionBryan MillerView Question on Stackoverflow
Solution 1 - JavascriptNaftaliView Answer on Stackoverflow