Module not found: Can't resolve 'dns'?

See original GitHub issue

error - ./node_modules/ioredis/built/cluster/ClusterOptions.js:3:0 Module not found: Can’t resolve ‘dns’

Source:

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const dns_1 = require("dns");

Looks the package.json does not include “dns” package.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
rajinwonderlandcommented, Jun 18, 2021

@baulml’s solution using webpack 5

module.exports = {
    webpack: (config, { isServer }) => {
        if (!isServer) {
             config.resolve.fallback.fs = false
             config.resolve.fallback.dns = false
             config.resolve.fallback.net = false
        }

        return config;
    }
}
7reactions
kmvancommented, May 4, 2021

Don’t run with browser. XD

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Can't resolve 'dns' when using MongoDB - Stack Overflow
This error most likely means you are trying to do something from the client-side that needs to be done on the server-side. If...
Read more >
Module not found Error: Can't resolve 'dns' · Issue #38 - GitHub
I really think there's a dependency problem, related to isemail, using dns. This error only occurs when I use ics, and ics librairy...
Read more >
[Solved]-Module not found: Can't resolve 'dns' in pg/lib-Reactjs
The solution was to add the externals property to my webpack.config.js file and include all the modules that cannot be resolved by Webpack....
Read more >
Getting "Module not found: Can't resolve 'dns'" error when ...
When I wrap my app in the tag I get this error and I do not understand why. Has anyone encountered this? I've...
Read more >
module-not-found - Next.js
The module you're trying to import uses Node.js specific modules, for example dns , outside of getStaticProps / getStaticPaths / getServerSideProps. Possible ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found