Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module not found: Can't resolve '@chainsafe/chainbridge-ui-core' in 'D:\chainbridge-ui\packages\example\src' #289

Open
Uponn opened this issue Nov 29, 2022 · 2 comments · May be fixed by #290
Assignees

Comments

@Uponn
Copy link

Uponn commented Nov 29, 2022

While trying to run the UI I encounter the following error:

D:\chainbridge-ui>yarn start:ui
yarn run v1.22.18
$ yarn wsrun -p @chainsafe/chainbridge-ui -c start
$ D:\chainbridge-ui\node_modules\.bin\wsrun -p @chainsafe/chainbridge-ui -c start
@chainsafe/chainbridge-ui
$ yarn setup:copy-dev-config && craco --max_old_space_size=4096 start
$ ./scripts/copy-dev-config.sh
 | i 「wds」: Project is running at https://192.168.1.3/
 | i 「wds」: webpack output is served from 
 | i 「wds」: Content not from webpack is served from D:\chainbridge-ui\packages\example\public
 | i 「wds」: 404s will fallback to /
 | Starting the development server...
 |
 | Failed to compile.
 | 
 | ./src/App.tsx
 | Module not found: Can't resolve '@chainsafe/chainbridge-ui-core' in 'D:\chainbridge-ui\packages\example\src'
 | Error from chokidar (D:\): Error: EBUSY: resource busy or locked, lstat 'D:\DumpStack.log.tmp'

I've tried using yarn start:ui yarn start:basic. Tried moving into packages/example and running yarn install there and yarn start, same error occures. I mainly see the error in App.tsx on those imports

import {
  ChainbridgeProvider,
  NetworkManagerProvider,
  LocalProvider,
} from "@chainsafe/chainbridge-ui-core";

Steps to Reproduce (for bugs)

  1. Clean clone of repo
  2. run yarn install
  3. run yarn start:ui, yarn start:basic

Versions

I've tried different versions of node, lowest that passes yarn install succesfully is 14.17.0, 16.15.0 and 16.17.1
Tried on Windows 10 and OSX.

@P1sar P1sar assigned P1sar and wainola and unassigned P1sar Nov 29, 2022
@wainola
Copy link
Contributor

wainola commented Nov 30, 2022

The issue here has to do with the way yarn workspaces work. Since the version of chainbridge-ui-core is the same as the one present in the npm registry, on install, yarn is not going to fetch dependency from registry but rather is going to create a symbolic link in the node_modules folder with the dependency. This symbolic link doesn't have the dist folder, hence, on the examples is not possible to import the modules or types associated with it.

The solution to this is to move examples folder outside the scope of packages, so when installing the dependencies of one of the examples, they are going to be fetched from npm registry.

@wainola wainola linked a pull request Nov 30, 2022 that will close this issue
9 tasks
@hangleang
Copy link

run yarn build:core to build core module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants