VueJS2 与 Solana Pay

发布于 2025-01-12 01:37:50 字数 1806 浏览 0 评论 0原文

我正在使用 VueJS 构建一个应用程序,我想将支付处理器与 SolanaPay 集成。我无法安装 SolanaPay 软件包,因为当我尝试导入它时,它给了我这个错误。

ERROR  Failed to compile with 3 errors                                                                      16:41:22 ч.

These dependencies were not found:

* @solana/web3.js in ./node_modules/@solana/buffer-layout-utils/lib/esm/web3.mjs, ./node_modules/@solana/pay/lib/esm/constants.mjs

我很确定这是 Vue/Webpack 问题,因为当我尝试安装这些包时 - @solana/web3.js & @solana/pay 在纯 Javascript 项目上他们可以工作。我还尝试从 vue-cli-service 中删除 @ 别名,但它不起作用。

package.json

{
  "name": "test_project",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "@solana/pay": "^0.1.3",
    "@solana/web3.js": "^1.36.0",
    "core-js": "^3.6.5",
    "vue": "^2.6.11",
    "vue-router": "^3.2.0",
    "vuetify": "^2.6.0"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.15",
    "@vue/cli-plugin-eslint": "~4.5.15",
    "@vue/cli-plugin-router": "~4.5.15",
    "@vue/cli-service": "~4.5.15",
    "babel-eslint": "^10.1.0",
    "eslint": "^6.7.2",
    "eslint-plugin-vue": "^6.2.2",
    "sass": "~1.32.0",
    "sass-loader": "^10.0.0",
    "vue-cli-plugin-vuetify": "~2.4.7",
    "vue-template-compiler": "^2.6.11",
    "vuetify-loader": "^1.7.0"
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/essential",
      "eslint:recommended"
    ],
    "parserOptions": {
      "parser": "babel-eslint"
    },
    "rules": {}
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not dead"
  ]
}

I'm building an application with VueJS and I want to integrate payment processor with SolanaPay. I got nowhere with the installation of the SolanaPay package, because when I try to import it it's giving me this error.

ERROR  Failed to compile with 3 errors                                                                      16:41:22 ч.

These dependencies were not found:

* @solana/web3.js in ./node_modules/@solana/buffer-layout-utils/lib/esm/web3.mjs, ./node_modules/@solana/pay/lib/esm/constants.mjs

I am pretty sure that's Vue/Webpack problem, because when I try to install these packages - @solana/web3.js & @solana/pay on plain Javascript project they work. I also tried removing the @ alias from vue-cli-service but it didn't work.

package.json

{
  "name": "test_project",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "@solana/pay": "^0.1.3",
    "@solana/web3.js": "^1.36.0",
    "core-js": "^3.6.5",
    "vue": "^2.6.11",
    "vue-router": "^3.2.0",
    "vuetify": "^2.6.0"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.15",
    "@vue/cli-plugin-eslint": "~4.5.15",
    "@vue/cli-plugin-router": "~4.5.15",
    "@vue/cli-service": "~4.5.15",
    "babel-eslint": "^10.1.0",
    "eslint": "^6.7.2",
    "eslint-plugin-vue": "^6.2.2",
    "sass": "~1.32.0",
    "sass-loader": "^10.0.0",
    "vue-cli-plugin-vuetify": "~2.4.7",
    "vue-template-compiler": "^2.6.11",
    "vuetify-loader": "^1.7.0"
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/essential",
      "eslint:recommended"
    ],
    "parserOptions": {
      "parser": "babel-eslint"
    },
    "rules": {}
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not dead"
  ]
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜清冷一曲。 2025-01-19 01:37:50

问题在于我的软件包版本 @solana/[email protected] 但是当我安装 @solana/[电子邮件受保护] 它已修复。

The problem was with package versions I had @solana/[email protected] but when I installed @solana/[email protected] it got fixed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文