简体   繁体   English

solana - /node_modules/@toruslabs/eccrypto/index.js:在 function 之外“返回”

[英]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.

相关问题 Webpack:node_modules / css / index.js没有返回函数 - Webpack: node_modules/css/index.js didn't return a function “加载程序Users / abc / node_modules / babel-core / index.js中的错误?{” presets”:[“ react”]}未返回函数” - “ERROR in loader Users/abc/node_modules/babel-core/index.js?{”presets“:[”react“]} didn't return a function ” 从 node_modules index.js 导入 class 定义 - import class definitions from node_modules index.js Jest js node_modules\\jest\\node_modules\\jest-cli\\build\\cli\\index.js:227 } catch { - Jest js node_modules\jest\node_modules\jest-cli\build\cli\index.js:227 } catch { 错误 in./src/index.js 模块构建失败(来自./node_modules/babel-loader/lib/index.js): - ERROR in ./src/index.js Module build failed (from ./node_modules/babel-loader/lib/index.js): 模块构建失败(来自 ./node_modules/babel-loader/lib/index.js)Vue Js - Module build failed (from ./node_modules/babel-loader/lib/index.js) Vue Js Nuxt.js:模块错误(来自./node_modules/eslint-loader/index.js): - Nuxt.js: Module Error (from ./node_modules/eslint-loader/index.js): node_modules \\ ng2-dragula \\ index.js不会导出&#39;DragulaModule&#39; - 'DragulaModule' is not exported by node_modules\ng2-dragula\index.js 未捕获的错误:模块构建失败(来自./node_modules/babel-loader/lib/index.js) - Uncaught Error: Module build failed (from ./node_modules/babel-loader/lib/index.js) Webpack SyntaxError - 模块构建失败(来自./node_modules/babel-loader/lib/index.js) - Webpack SyntaxError - Module build failed (from ./node_modules/babel-loader/lib/index.js)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM