[英]solana - /node_modules/@toruslabs/eccrypto/index.js: 'return' outside of function
I am using vue
for solana
development.我正在使用
vue
进行solana
开发。
The library I use is @solana/wallet-adapter我使用的库是@solana/wallet-adapter
error shows:错误显示:
/node_modules/@toruslabs/eccrypto/index.js: 'return' outside of function
Since the example is only for React
, it's hard for me to find the root cause of the error.由于该示例仅适用于
React
,因此我很难找到错误的根本原因。
App.vue应用程序.vue
<template>
<div id="app">
<WalletConnectButton/>
</div>
</template>
<script>
import { ConnectionProvider, WalletProvider } from '@solana/wallet-adapter-vue';
import { WalletAdapterNetwork } from '@solana/wallet-adapter-base';
import {
getLedgerWallet,
getPhantomWallet,
getSlopeWallet,
getSolflareWallet,
getSolletExtensionWallet,
getSolletWallet,
getTorusWallet,
} from '@solana/wallet-adapter-wallets';
import {
WalletDisconnectButton,
WalletMultiButton,
WalletConnectButton
} from '@solana/wallet-adapter-vue-ui';
import { clusterApiUrl } from '@solana/web3.js';
export default {
name: "App",
components: {
}
};
</script>
<style>
#app {
font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>
Codesandbox代码沙盒
https://codesandbox.io/s/strange-oskar-j1byt?file=/src/App.vue:0-906 https://codesandbox.io/s/strange-oskar-j1byt?file=/src/App.vue:0-906
Im not sure if this helps or not, but maybe the module is missing.我不确定这是否有帮助,但也许模块丢失了。
npm i @toruslabs/eccrypto
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.