Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

409
Visualizações
Next js Module not found: Can't resolve 'fs'

I am working on converting React.js app to Next.js app project. I had to copy and paste few folders and import. Then after I got this error

enter image description here

Acrroding to the This stackoverflow question

I updated the next.config.js file

const path = require("path");
const withOptimizedImages = require("next-optimized-images");
const nextTranslate = require("next-translate");
const i18nConfig = require("./i18n-config.json");
const withBundleAnalyzer = require("@next/bundle-analyzer")({
    enabled: process.env.ANALYZE === "true"
});
require("dotenv").config();

module.exports = withBundleAnalyzer(
    nextTranslate(
        withOptimizedImages({
            useFileSystemPublicRoutes: false,
            productionBrowserSourceMaps: true,
            i18n: {
                ...i18nConfig
            },
            handleImages: ["png"],
            inlineImageLimit: 68,
            responsive: {
                adapter: require("responsive-loader/jimp")
            },
            defaultImageLoader: "responsive-loader",
            sassOptions: {
                includePaths: [path.join(__dirname, "styles")]
            },
            webpack5: true,
            webpack(config) {
                config.module.rules.push({
                    test: /\.svg$/,
                    use: [
                        {
                            loader: "@svgr/webpack",
                            options: {
                                titleProp: true,
                                svgoConfig: {
                                    plugins: {
                                        removeViewBox: false
                                    }
                                }
                            }
                        }
                    ]
                });
                config.resolve.fallback = { fs: false };

               
               

                return config;
            }
        })
    )
);

I have added this two-line

webpack5: true,

config.resolve.fallback = { fs: false };

But still, the error is the same. My webpack version "@svgr/webpack": "5.5.0", My next js version "next": "10.0.9",

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda