我是 JavaScript 和 vscode 的新手,设置它比我在工作中使用的任何其他语言都要困难。当我运行代码时(在 Test.js 中):
var msg = 'here';
console.log(msg);
import { Machine, interpret } from 'xstate';
我收到一条错误消息,提示我必须使用 import 来加载 ES 模块。尽管尝试了这些修复,但我查看了类似的 StackExchange 线程无济于事。感谢任何帮助和可读资源。谢谢。
具体错误调试打印输出:
Waiting for the debugger Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: