Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140762

Node - Protractor "SyntaxError: Cannot use import statement outside a module" when switching to ES6 modules

$
0
0

File 'main' needs function 'httpGet' from file 'support.js'

In 'main' I changed from

const { httpGet } = require('./support');

to

import { httpGet } from './support';

and in the support file from

exports.httpGet = (siteUrl) => {

to

export function httpGet(siteUrl) {

but I get

import { httpGet } from ('./support');
^^^^^^

SyntaxError: Cannot use import statement outside a module

What am I missing ?


Viewing all articles
Browse latest Browse all 140762

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>