-
Notifications
You must be signed in to change notification settings - Fork 541
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Current Behavior
Can't build my NextJS project due to unsupported directory import error. It happens since version 2.1.8 of the package @web3-onboard/react
@web3-onboard/react v2.1.6 is the last version that I can get it to work
Expected Behavior
No response
Steps To Reproduce
- In a NextJs v12.1.6 project
- Import and use web3-onboard in the project (for example init, or injectedModule)
- Run
yarn build
What package is effected by this issue?
@web3-onboard/react
Is this a build or a runtime issue?
Build
Package Version
2.1.8 and above
Node Version
18.7.0
What browsers are you seeing the problem on?
No response
Relevant log output
Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/Users/charlym/repos/my-project/node_modules/@web3-onboard/react/dist/hooks' is not supported resolving ES modules imported from /Users/charlym/repos/my-project/node_modules/@web3-onboard/react/dist/index.js
at new NodeError (node:internal/errors:387:5)
at finalizeResolution (node:internal/modules/esm/resolve:400:17)
at moduleResolve (node:internal/modules/esm/resolve:965:10)
at defaultResolve (node:internal/modules/esm/resolve:1173:11)
at nextResolve (node:internal/modules/esm/loader:173:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:852:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:439:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
at link (node:internal/modules/esm/module_job:75:36) {
type: 'Error',
code: 'ERR_UNSUPPORTED_DIR_IMPORT',
url: 'file:///Users/charlym/repos/my-project/node_modules/@web3-onboard/react/dist/hooks'
}Anything else?
A similar issue was pointed out here
And resolved here
Sanity Check
- 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.
wraeth-eth
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working