【问题标题】:Call @metaplex/js from html从 html 调用 @metaplex/js
【发布时间】:2022-08-17 03:10:44
【问题描述】:

我想知道如何将@metaplex/js 模块导入到连接到 html 的 js 文件中。如果我使用导入语句,我会收到一条错误消息,提示“导入标识符必须以 \".\"、\"./\"\" 和类似的内容开头。对于 solanaWeb3,我必须添加一个带有 unpkg 链接的脚本标签作为 src 及其工作。我想知道在哪里可以找到与@metaplex.js 相同的脚本 src,这样我也可以使用它;)。

import { programs } from \"@metaplex/js\"

这是使用的导入语句,这是我得到的错误

Uncaught TypeError: Error during the resolution of the module identificator “@metaplex/js”. Module identificators must start with “./”, “../” o “/”.

标签: javascript html import solana metaplex


【解决方案1】:

你可以试试:

<script src="https://unpkg.com/@metaplex/js@latest/lib/index.iife.min.js">
</script>

【讨论】:

    猜你喜欢
    • 2022-01-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多