我正在开发一个快速应用程序,我正在尝试执行以下操作,但我一遍又一遍地遇到相同的错误 - “GET http://localhost:3000/javascript/module2 net::ERR_ABORTED 404 (Not Found)”
有人可以向我指出我犯了什么错误并指出我正确的方向吗?下面是我的代码 -
模块1.js
import theFunc from "./module2";
console.log("In module 1");
theFunc();
Run Code Online (Sandbox Code Playgroud)
模块2.js
export default function theFunc() {
console.log("from module 2");
}
Run Code Online (Sandbox Code Playgroud)
索引.html
<html>
<body>
Should show the result in console.
<script type="module" src="./javascript/module1.js"></script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
提前致谢!:)