[Yarn workspaces config] Cannot find module '@algo-builder/web' or its corresponding type declarations.
MetaB0y opened this issue · 4 comments
Describe the bug
I have tried to contribute to this repo which generally was a smooth experience. However, there was a single problem which made it a bit less convenient, yarn
didn't work properly out-of-the-box.
Expected Behavior
I run yarn install
[and pipenv install && pipenv shell
] and then followed the README:
cd packages/runtime
yarn run test
Current Behavior
It failed with the following error
TSError: ⨯ Unable to compile TypeScript:
src/errors/runtime-errors.ts:1:43 - error TS2307: Cannot find module '@algo-builder/web' or its corresponding type declarations.
Possible Solution
I solved it by adding "@algo-builder/web": "workspace:*"
to dependencies of the top-level package.json
. I think it is how things should actually be configured, i.e. root project shall depend on all packages. However, I am not an expert on this topic.
Environment
- OS: macOS
- Node.js version: v18.7.0
- algob version: master
Did you run 'yarn build' command after install?
No, I didn't. So probably my bad. But still maybe it would make sense to add it to README.md.
Thanks for reporting @MetaB0y . I'm going to update README.
Dependencies listed in the workspace package.json should be strictly limited. Usually it's only related to tools. But definitely not a library dependencies.
solved in 7229f19