1

I am new to JavaScript and vscode and getting it set up has been more difficult than any other language I have used at work. When I run the code (in Test.js):

    var msg = 'here';
    console.log(msg);
    import { Machine, interpret } from 'xstate';

I get a error saying that I must use import to load ES module. I have looked at similar StackExchange threads to no avail despite attempting those fixes. Any help and readable resources are appreciated. Thanks.

Specific error debug printout:

Waiting for the debugger Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: 
ebbishop
  • 1,833
  • 2
  • 20
  • 45
Chilly
  • 25
  • 5

1 Answers1

0

Put the import line at the top.

double-beep
  • 5,031
  • 17
  • 33
  • 41
F.NiX
  • 1,457
  • 3
  • 12
  • 20