question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: Jest can't resolve ipfs-http-client

See original GitHub issue

Version

29.2.2

git@github.com:ssadler/jest-resolver-ipfs.git

Steps to reproduce

Check out repository: https://github.com/ssadler/jest-resolver-ipfs

yarn
npx jest

Expected behavior

Is able to import the module

Actual behavior

Can’t import the module

Additional context

Digging into it further, I found it resolves the module folder but when it gets to the point of resolving the entrypoint from "exports" it fails. If you add “import” to options.conditions, then it does import the module but fails with a parse error when it encounters import ... in the code.

In my Typescript project, I have set transformIgnorePatterns: [],, but this doesn’t seem to help.

Also tried enhanced-resolve (doesn’t make any difference), and jest-light-runner which gives: Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No “exports” main defined

Thanks

Environment

System:
    OS: Linux 5.15 Ubuntu 22.04 LTS 22.04 LTS (Jammy Jellyfish)
    CPU: (16) x64 AMD Ryzen 7 PRO 4750U with Radeon Graphics
  Binaries:
    Node: 18.12.0 - ~/.nvm/versions/node/v18.12.0/bin/node
    Yarn: 3.2.1 - ~/.nvm/versions/node/v16.16.0/bin/yarn
    npm: 8.19.2 - ~/.nvm/versions/node/v18.12.0/bin/npm

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

3reactions
isaacudofiacommented, Nov 2, 2022

I think you should do the following below: npm uninstall --save ipfs-http-client npm i --save ipfs-http-client@33.1.1

1reaction
aignermaxcommented, Nov 16, 2022

the 33.1.1 version does not seem to have type definitions for typescript, at least I get a lot of errors after downgrading. What is the problem with the newest version of ipfs-http-client and why should there be a need to downgrade?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Module not found: Can't resolve 'ipfs-http-client' in 'D:\Pro\src ...
Try using earlier version I have just tried it. Do the following : npm uninstall --save ipfs-http-client npm i --save ipfs-http-client@33.1.
Read more >
ipfs-http-client - npm
Start using ipfs-http-client in your project by running `npm i ... A URL that resolves to a running instance of the IPFS HTTP...
Read more >
Add file to ipfs (node.js) - Infura Community
I cant find any example code for node.js in documentation. ... const ipfsClient = require('ipfs-http-client'); const projectId = '1x.
Read more >
ipfs-api | Yarn - Package Manager
ipfs-api has been renamed to ipfs-http-client, please update your package.json to get the latest version. A client library for the IPFS HTTP API....
Read more >
jest typeerror: class extends value - You.com | The AI Search ...
Runtime error in jest - TypeError: Class extends value undefined is not a ... is there any way to fix this or disable...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found