js-ipfs icon indicating copy to clipboard operation
js-ipfs copied to clipboard

Browser hangup during create method

Open metrocoding opened this issue 2 years ago • 3 comments

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>

Severity:

Medium

metrocoding avatar Jul 27 '22 08:07 metrocoding

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.

welcome[bot] avatar Jul 27 '22 08:07 welcome[bot]

unless I'm missing something

const saveMetaData: async (metaData) => { should probably be const saveMetaData = async (metaData) => {

legalizemath avatar Aug 15 '22 01:08 legalizemath

unless I'm missing something

const saveMetaData: async (metaData) => { should probably be const 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

metrocoding avatar Aug 15 '22 05:08 metrocoding

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!

SgtPooki avatar May 26 '23 19:05 SgtPooki