blocknative / web3-onboard

Client library to onboard users to web3 apps
https://onboard.blocknative.com/
MIT License
837 stars 498 forks source link

[Bug]: Cannot mix different versions of joi schemas #1287

Closed sgehrman closed 2 years ago

sgehrman commented 2 years ago

Current Behavior

Cannot mix different versions of joi schemas

Expected Behavior

should work

Steps To Reproduce

do stuff

What package is effected by this issue?

@web3-onboard/core

Is this a build or a runtime issue?

Build

Package Version

2.8.4

Node Version

17

What browsers are you seeing the problem on?

Chrome

Relevant log output

─┬ @web3-onboard/coinbase@2.1.2
│ ├─┬ @coinbase/wallet-sdk@3.5.2
│ │ └─┬ @solana/web3.js@1.52.0
│ │   └─┬ react-native-url-polyfill@1.3.0
│ │     └─┬ react-native@0.70.1
│ │       └─┬ @react-native-community/cli@9.1.1
│ │         ├─┬ @react-native-community/cli-config@9.1.0
│ │         │ └── joi@17.6.1 deduped
│ │         └─┬ @react-native-community/cli-types@9.1.0
│ │           └── joi@17.6.1 deduped
│ └─┬ @web3-onboard/common@2.2.2
│   └── joi@17.6.1 deduped
├─┬ @web3-onboard/core@2.8.4
│ └── joi@17.6.0
├─┬ @web3-onboard/injected-wallets@2.2.3
│ └── joi@17.6.1
└─┬ @web3-onboard/keepkey@2.3.0
  └─┬ @web3-onboard/hw-common@2.0.2
    └── joi@17.6.1 deduped

Anything else?

No response

Sanity Check

Maadhav commented 2 years ago

I am facing the same issue

Adamj1232 commented 2 years ago

@sgehrman how is this bug presenting? What are your steps to display reproduce errors?

sgehrman commented 2 years ago

I don't know why this just started happening today. I'm building a nextjs project.

info  - Linting and checking validity of types  
info  - Creating an optimized production build  
info  - Compiled successfully
info  - Collecting page data ..Error: Cannot mix different versions of joi schemas
    at new module.exports (/home/steve/Documents/GitHub/mavrik/fe-infinity/node_modules/@hapi/hoek/lib/error.js:23:19)
    at module.exports (/home/steve/Documents/GitHub/mavrik/fe-infinity/node_modules/@hapi/hoek/lib/assert.js:21:11)
    at Object.exports.isSchema (/home/steve/Documents/GitHub/mavrik/fe-infinity/node_modules/@web3-onboard/core/node_modules/joi/lib/common.js:132:5)
    at Object.internals.schema (/home/steve/Documents/GitHub/mavrik/fe-infinity/node_modules/@web3-onboard/core/node_modules/joi/lib/compile.js:66:16)
    at Object.exports.schema (/home/steve/Documents/GitHub/mavrik/fe-infinity/node_modules/@web3-onboard/core/node_modules/joi/lib/compile.js:17:26)
    at internals.Base.$_compile (/home/steve/Documents/GitHub/mavrik/fe-infinity/node_modules/@web3-onboard/core/node_modules/joi/lib/base.js:645:24)
    at /home/steve/Documents/GitHub/mavrik/fe-infinity/node_modules/@web3-onboard/core/node_modules/joi/lib/types/keys.js:260:92
    at Object.exports.tryWithPath (/home/steve/Documents/GitHub/mavrik/fe-infinity/node_modules/@web3-onboard/core/node_modules/joi/lib/common.js:176:16)
    at internals.Base.method [as keys] (/home/steve/Documents/GitHub/mavrik/fe-infinity/node_modules/@web3-onboard/core/node_modules/joi/lib/types/keys.js:260:32)
    at Object.args (/home/steve/Documents/GitHub/mavrik/fe-infinity/node_modules/@web3-onboard/core/node_modules/joi/lib/types/keys.js:49:23) {
  path: 'namespace'
}
Maadhav commented 2 years ago

The same case with me. I have been working on the project for the past 2 weeks, and it was working fine, but just after I deleted my node_modules folder and built my project again this error appeared. Now I can't even run yarn dev

Maadhav commented 2 years ago

@sgehrman For now I found a fix in order to build.

  1. Delete yarn.lock and the node_modules folder
  2. Do npm install
  3. npm dedupe (The Fix 🥇 )
  4. npm run build

Note: this method didn't work with yarn for me.

Let me know if this works for, I just made it work using this. I hope the dev team fix the issue asap.

Adamj1232 commented 2 years ago

@Maadhav Working on a fix now, will notify when a alpha packages are published to test with

Adamj1232 commented 2 years ago

@Maadhav @sgehrman I have alpha versions published with patch version bumps, please check out https://github.com/blocknative/web3-onboard/pull/1290 for version changes and you can test with those versions. A Team member will update here when official versions are released

sgehrman commented 2 years ago

how soon until the official? Tonight would be helpful.

arjunvkurup commented 2 years ago

Is this issue fixed? I am getting the same error, but when the build is done in vercel. However, the build is successful while running it locally.

Screenshot 2022-09-26 at 14 37 51

konitroos commented 2 years ago

A release of the latest merge would be really helpful. Facing the same issue of multiple joi versions for my react native app.

konitroos commented 2 years ago

Sharing logs from my project:

[4/4] 🚡  Calculating file sizes...
=> Found "joi@17.6.1"
info Has been hoisted to "joi"
info Reasons this module exists
   - Hoisted from "@web3-onboard#common#joi"
   - Hoisted from "@web3-onboard#gas#joi"
   - Hoisted from "@web3-onboard#injected-wallets#joi"
   - Hoisted from "@web3-onboard#magic#joi"
   - Hoisted from "react-native#@react-native-community#cli#joi"
   - Hoisted from "@web3-onboard#dcent#@web3-onboard#hw-common#joi"
   - Hoisted from "@web3-onboard#portis#@web3-onboard#common#joi"
info Disk size without dependencies: "600KB"
info Disk size with unique dependencies: "920KB"
info Disk size with transitive dependencies: "920KB"
info Number of shared dependencies: 5
=> Found "@web3-onboard/core#joi@17.6.0"
info This module exists because "@web3-onboard#react#@web3-onboard#core" depends on it.
info Disk size without dependencies: "596KB"
info Disk size with unique dependencies: "916KB"
info Disk size with transitive dependencies: "916KB"
info Number of shared dependencies: 5
lnbc1QWFyb24 commented 2 years ago

Fixed and released in v2.12.0