Skip to content
Advertisement

Import not working with JavaScript in PhpStorm/Webstorm

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

main.js

JavaScript

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.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement