I'm trying to import myArr
from hello.js into index.js. However I get an error of
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module
hello.js
export let myArr = ['hello', 'hi', 'hey'];
index.js
import { myArr } from './hello.js';
console.log(myArr);
Where am I going wrong?
See Question&Answers more detail:os