web3-onboard icon indicating copy to clipboard operation
web3-onboard copied to clipboard

[Bug]: Cannot mix different versions of joi schemas

Open sgehrman opened this issue 1 year ago • 8 comments

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/[email protected]
│ ├─┬ @coinbase/[email protected]
│ │ └─┬ @solana/[email protected]
│ │   └─┬ [email protected]
│ │     └─┬ [email protected]
│ │       └─┬ @react-native-community/[email protected]
│ │         ├─┬ @react-native-community/[email protected]
│ │         │ └── [email protected] deduped
│ │         └─┬ @react-native-community/[email protected]
│ │           └── [email protected] deduped
│ └─┬ @web3-onboard/[email protected]
│   └── [email protected] deduped
├─┬ @web3-onboard/[email protected]
│ └── [email protected]
├─┬ @web3-onboard/[email protected]
│ └── [email protected]
└─┬ @web3-onboard/[email protected]
  └─┬ @web3-onboard/[email protected]
    └── [email protected] deduped

Anything else?

No response

Sanity Check

  • [X] If this is a build issue, I have included my build config. If this is a runtime issue, I have included reproduction steps and/or a Minimal, Reproducible Example.

sgehrman avatar Sep 22 '22 14:09 sgehrman

I am facing the same issue

Maadhav avatar Sep 22 '22 14:09 Maadhav

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

Adamj1232 avatar Sep 22 '22 15:09 Adamj1232

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'
}

sgehrman avatar Sep 22 '22 15:09 sgehrman

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 avatar Sep 22 '22 15:09 Maadhav

@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.

Maadhav avatar Sep 22 '22 15:09 Maadhav

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

Adamj1232 avatar Sep 22 '22 15:09 Adamj1232

@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

Adamj1232 avatar Sep 22 '22 21:09 Adamj1232

how soon until the official? Tonight would be helpful.

sgehrman avatar Sep 23 '22 03:09 sgehrman

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

arjunvkurup avatar Sep 26 '22 12:09 arjunvkurup

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

konitroos avatar Sep 26 '22 16:09 konitroos

Sharing logs from my project:

[4/4] 🚡  Calculating file sizes...
=> Found "[email protected]"
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#[email protected]"
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

konitroos avatar Sep 26 '22 17:09 konitroos

Fixed and released in v2.12.0

lnbc1QWFyb24 avatar Sep 26 '22 22:09 lnbc1QWFyb24