我正在尝试将@project-serum/anchor导入到Vue 3项目中, import * as anchor from '@project-serum/anchor'; 项目编译得很好,但是当组件加载时,它会抛出一个错误: VM28957:1 Uncaught (in promise) ReferenceError: require is not defined
at eval (eval at/node_modules/js-sha256/src
我正在学习一个使用锚的介绍教程(solana框架),它是基于官方的github。_load (node:internal/modules/cjs/loader:778:27) at require (node:internal/modules/cjs/helpers:102:18)
at Object.我还附上
我该如何实现这一点? 我试图将这两个函数“导入”到第三个函数中,然后在规则中引用该函数,但是js不允许在没有定义模块的情况下进行导入。(设置<script type="module">后) Unexpected token '<' 当I "require“时,两个函数"require”未定义。require is not defined