GithubHelp home page GithubHelp logo

Comments (11)

tcollinsworth avatar tcollinsworth commented on August 18, 2024 3

I just tried it in a non-esm project and I get the same error. I'll publish a fix in the next few days. I do have a day job.

from axios-cached-dns-resolve.

tcollinsworth avatar tcollinsworth commented on August 18, 2024 1

Done

from axios-cached-dns-resolve.

tcollinsworth avatar tcollinsworth commented on August 18, 2024

The newer versions fix bugs. I'm not maintaining older versions.

from axios-cached-dns-resolve.

fbozic avatar fbozic commented on August 18, 2024

But I'm trying to use version 1.2.1 and that one is not working. Older ones are working. I don't see any newer version.
It also fail on runkit: https://npm.runkit.com/axios-cached-dns-resolve

from axios-cached-dns-resolve.

tcollinsworth avatar tcollinsworth commented on August 18, 2024

Ah, now I understand. In one of the later versions of the lib I dropped transpiling and used esm. That's why it's complaining for you about export. If you load esm in prior to this library loading, that error will go away. In the latest version of node 14, esm isn't even necessary anymore, but you have to add a module line in package.json and change extensions from .js to .mjs.

from axios-cached-dns-resolve.

joewestcott avatar joewestcott commented on August 18, 2024

I spent an hour today attempting to import v1.2.1 in various ways, receiving the same issues as mentioned in the first post.

v0.5.2 worked perfectly for my needs, preventing axios continually re-resolving DNS. Thank you for this library. 😺

from axios-cached-dns-resolve.

tcollinsworth avatar tcollinsworth commented on August 18, 2024

For reference:

  • What version of node are you using?
  • Are you transpiling?
  • Are you using esm?

I'll test it out this evening in a new node 14 project.

from axios-cached-dns-resolve.

joewestcott avatar joewestcott commented on August 18, 2024

Node v15.3.0, no transpiling or build system. I've tried ESM import and commonJS style require() imports. I've tried with and without importing the esm package on line one.

Hope that helps!

from axios-cached-dns-resolve.

tcollinsworth avatar tcollinsworth commented on August 18, 2024

Just published a new version 2.0.0 that is ES Module/ESM/mjs.

from axios-cached-dns-resolve.

joewestcott avatar joewestcott commented on August 18, 2024

Hi @tcollinsworth, thanks for this!

In node, using v2 I'm getting
Error [ERR_MODULE_NOT_FOUND]: Cannot find package node_modules/axios-cached-dns-resolve/

I think main in package.json needs to be changed to index.mjs? Thanks.

from axios-cached-dns-resolve.

tcollinsworth avatar tcollinsworth commented on August 18, 2024

My bad. Devils in the details. Updating now.

from axios-cached-dns-resolve.

Related Issues (18)

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.