-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Error : Agent is not a constructor while using 54.0.0 #3938
Comments
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
Finally, remember to use https://discuss.ipfs.io if you just need general support. |
I am also getting the error on the latest version 0.60.0 |
Same for me on 53.0.1 and 54.0.0 |
same for me on the latest ^54.0.1 and 53.0.1 |
What version of node are you running? |
@achingbrain |
For me this error occurs probably because default Agent is now taken from |
I'm having trouble replicating this, can you tell me a bit more about your setup please, supply a stack trace and preferably provide a repro case that shows the error? You say "IPFS on the server end" but
The file the It's also loaded by the /agent file in the published tarball, but that file is only there for compatibility with tools that use resolve like jest and browserify and should be ignored by any node.js that supports the
If you're getting the "browser" export in node.js there must be something about your project/env that's triggering this as it's not intended or documented behaviour. |
Thank you for the response. That's what I suspected (the problem being our project) however it was working for us before. I printed the
It looks like it knows that it's a node env but still reaches for agent.browser.js? |
Can you please share a link to your project or a repro repo with instructions on how to replicate this issue? |
Sure! TryQuiet/waggle#152 |
To fix bugs like ipfs/js-ipfs#3938 where Jest ends up resolving browser specific code, use a version of ipjs with the fix.
To fix bugs like ipfs/js-ipfs#3938 where Jest ends up resolving browser specific code, use a version of ipjs with the fix.
To fix bugs like ipfs/js-ipfs#3938 where Jest ends up resolving browser specific code, use a version of ipjs with the fix.
To fix bugs like ipfs/js-ipfs#3938 where Jest ends up resolving browser specific code, use a version of ipjs with the fix.
Pulls in new ipjs which stubs files that require the node version of modules. Fixes #3938
Pulls in new ipjs which stubs files that require the node version of modules. Fixes #3938
This should be fixed in |
The newest patch fixes "Agent is not a constructor" error introduced in one of the previous versions ipfs/js-ipfs#3938
Thank you! The new patch works for me :D |
* Upgrade orbitdb to 0.28.0 and its dependencies (libp2p@0.33.0, ipfs@0.59.0) * Upgrade multiaddr Add orbit-db-io to project dependencies, lack of it causes "IPFSAccessController.save ERROR: Error: Deprecated, use .toString()" and "Something went wrong Error: `undefined` is not supported by the IPLD Data Model and cannot be encoded" * Upgrade libp2p-websockets * Lint * Add ipfs-log to dependencies * Remove wrtc; fix Multiaddress import in test * Fix * Add jest setup with global.crypto * Bump ipfs to 0.60.2 The newest patch fixes "Agent is not a constructor" error introduced in one of the previous versions ipfs/js-ipfs#3938 * IPFS initialization fix - pass pregenerated peerID's private key as 'init' options to create method * CI replication test - increase number of entries * Cleanup * Upgate changelog * Fix/replace find free port (#161) * Changed library for getting ports * Fix test utils import * send message instead ids * Close websocket connection (#167) Co-authored-by: Emilia Marczyk <emilia.marczyk@rumblefish.pl> Co-authored-by: Wiktor Sieprawski <wiktor.sieprawski@rumblefish.pl> Co-authored-by: bartosz.chyra <bartosz.chyra@rumblefish.pl>
* Upgrade orbitdb to 0.28.0 and its dependencies (libp2p@0.33.0, ipfs@0.59.0) * Upgrade multiaddr Add orbit-db-io to project dependencies, lack of it causes "IPFSAccessController.save ERROR: Error: Deprecated, use .toString()" and "Something went wrong Error: `undefined` is not supported by the IPLD Data Model and cannot be encoded" * Upgrade libp2p-websockets * Lint * Add ipfs-log to dependencies * Remove wrtc; fix Multiaddress import in test * Fix * Add jest setup with global.crypto * Bump ipfs to 0.60.2 The newest patch fixes "Agent is not a constructor" error introduced in one of the previous versions ipfs/js-ipfs#3938 * IPFS initialization fix - pass pregenerated peerID's private key as 'init' options to create method * CI replication test - increase number of entries * Cleanup * Upgate changelog * Fix/replace find free port (#161) * Changed library for getting ports * Fix test utils import * send message instead ids * Close websocket connection (#167) Co-authored-by: Emilia Marczyk <emilia.marczyk@rumblefish.pl> Co-authored-by: Wiktor Sieprawski <wiktor.sieprawski@rumblefish.pl> Co-authored-by: bartosz.chyra <bartosz.chyra@rumblefish.pl>
Pulls in new ipjs which stubs files that require the node version of modules. Fixes #3938
Version: 53.0.1 and 54.0.0
Platform: Linux
Severity: High Severity
Issue:
A few days back IPFS on the server end started throwing the following error
Agent is not a constructor
I was getting this error while initializing the ipfs instance.
The text was updated successfully, but these errors were encountered: