Code Monkey home page Code Monkey logo

Comments (4)

arantes555 avatar arantes555 commented on June 13, 2024

Hello @RoyTimes

The require in question should already be warded to only be called if process.versions.electron is truthy.

If you are not on electron, why are you using electron-fetch? Or is your built file supposed to be able to run both on electron and on node? In any case, I thing you could "mark it as external", as the electron module is never supposed to be bundled.

If you can explain more about your setup, maybe we can find another solution. If you are sure that there needs to be a change in electron-fetch, could you provide me with a minimal repo that reproduces this issue ? I am not familiar with esbuild

from electron-fetch.

RoyTimes avatar RoyTimes commented on June 13, 2024

Thanks for the reply.

I was intent to build for browser and electron-fetch was not included intentionally. By yarn.lock, I think it was included by ipfs-utils.

So:

  1. Frankly, I'm not familiar with esbuild as well. The code runs well but returns error when bundling. I guess the first step is for me to switch over to Webpack. It's likely that esbuild treat the conditioning of the require differently.
  2. If the error remains: I'll raise an issue on ipfs-utils.
  3. If none of these works: I'll make a repo to reproduce and share it with you.

I understand that this is most likely not related to electron-fetch at all. So I'll leave you alone for now but might come back later when I have a better understanding of the issue. : )

from electron-fetch.

arantes555 avatar arantes555 commented on June 13, 2024

@RoyTimes Allright, I'll leave the issue open for the moment. Don't hesitate to let me know here if it got solved another way, or if you didn't manage to fix it.

In any case, I want to reiterate my suggestion to mark "electron" as external. With most builders, it's something you gotta do.

from electron-fetch.

RoyTimes avatar RoyTimes commented on June 13, 2024

Webpack solves it somehow. Closing.

from electron-fetch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.