我已经导入了一个模块到我的项目中。当单独运行它时,它工作得很好。当我想在浏览器中使用它时,它就会出现问题。
Uncaught TypeError: Failed to resolve module specifier "theblockchainapi". Relative references must start with either "/", "./", or "../".
我的导入是这样的:
<script type="module" src="./app.js"></script>
app.js以:
开头import theblockchainapi from 'theblockchainapi';
更改自:
import theblockchainapi from 'theblockchainapi';
:
const theblockchainapi = require('theblockchainapi');