js-ipfs
js-ipfs copied to clipboard
Browser hangup during create method
Hi, my browser is freezing till create promise is resolved in then. only firefox, its ok on Safari and Chrome
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.min.js" integrity="sha256-BOLUCfwJIrl77f7h7q0mPaoJsOOrc+eE/i+XqTQSIJM=" crossorigin="anonymous"></script>
<script>
let ipfsNode = null;
const Ipfs = window.IpfsCore;
document.addEventListener("DOMContentLoaded", async () => {
Ipfs.create().then(n => {
// about 26000ms
ipfsNode = n;
});
});
const saveMetaData = async (metaData) => {
try {
//const ipfsNode = await Ipfs.create();
const result = await ipfsNode.add(JSON.stringify(metaData));
return result.path;
} catch (e) {
console.error("Error saving metadata to IPFS", e);
return null;
}
}
</script>
-
Version: [email protected]
-
Platform: macOS 12.5 browser firefox 102.0.1
Severity:
Medium
Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review. In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment. Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:
- "Priority" labels will show how urgent this is for the team.
- "Status" labels will show if this is ready to be worked on, blocked, or in progress.
- "Need" labels will indicate if additional input or analysis is required.
Finally, remember to use https://discuss.ipfs.io if you just need general support.
unless I'm missing something
const saveMetaData: async (metaData) => {
should probably be const saveMetaData = async (metaData) => {
unless I'm missing something
const saveMetaData: async (metaData) => {
should probably beconst saveMetaData = async (metaData) => {
I just made mistake in here by : instead of = But it's fine in my real code the problem is with creat method only in firefox
js-ipfs is being deprecated in favor of Helia. You can https://github.com/ipfs/js-ipfs/issues/4336 and read the migration guide.
Please feel to reopen with any comments by 2023-06-02. We will do a final pass on reopened issues afterward (see https://github.com/ipfs/js-ipfs/issues/4336).
This issue is most likely resolved in Helia, please try it out!