'VueJS2 with Solana Pay

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"
  ]
}


Solution 1:[1]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 GhoSTBG