-
-
Notifications
You must be signed in to change notification settings - Fork 290
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
Importing @lodestar/types
fails, it's unusable
#6076
Comments
I had to do a full conversion to ESM modules for the Jest to start working. I followed this guide. package.json - must include
setup-jest.js
jest.config.cjs
ImportantYou need to run tests with |
I quickly looked at this yesterday but couldn't figure it out, wanted to look at it again today but glad you figured out a solution and thanks for sharing it here. We recently started to migrate from mocha to vitest, and jest was also considered as an option ,see #6028 for details. This PR highlights the following for jest
Maybe there is a simpler way to make your setup work, @nazarhussain might have some suggestions. Wondering if there is anything we could do on our end to make this less painful, but I guess at some point ESM will be the default everywhere and those issues will go away.. |
Describe the bug
Importing
@lodestar/types
fails, cannot make it work.Expected behavior
One can import and use the
@lodestar/types
moduleSteps to reproduce
npm i
npm run test
ERROR: src/main.ts:5:21 - error TS2307: Cannot find module '@lodestar/types' or its corresponding type declarations.
moduleResolution
intsconfig.json
tonode
, re-run 3. and observe:Cannot find module '@lodestar/types' from 'src/main.ts'
Additional context
No response
Operating system
macOS
Lodestar version or commit hash
@lodestar/types 1.11.3
The text was updated successfully, but these errors were encountered: