Coder Social home page Coder Social logo

Comments (3)

JimmyBeldone avatar JimmyBeldone commented on September 27, 2024

Hi !

I quickly looked into it and it's a Webpack 5 compatibility issue with some Webpack-bundle-analyzer combinations of options.

I tested several combinations, and devMode: true option seems to be the only combination not working with Gatsby v3.

Hopefully it will be fixed soon by Webpack-bundle-analyzer maintainers, in the meantime this is what I suggest :

  • If you don't really need it when running gatsby develop:
    --> Remove devMode: true from plugin options. You can visualize the result running gatsby build instead.

  • If you need it when running gatsby develop:
    --> I suggest you disable analyser and generate a stats file. You can set it up this way in plugin options :

module.exports = {
    plugins: [
        {
            resolve: 'gatsby-plugin-webpack-bundle-analyser-v2',
            options: {
                analyzerMode: 'disabled',
                devMode: true,
                generateStatsFile: true,
                statsOptions: {
                    source: false,
                },
            },
        },
    ],
};

gatsby-config.js

This will generate a stats.jsonfile at the root of your project. You can visualize this stats with Webpack-bundle-analyzer CLI using this command : npx webpack-bundle-analyzer ./path/to/stats.json

If you need to set some options here are the possible options : https://github.com/webpack-contrib/webpack-bundle-analyzer#options-for-cli

Let me know if it works for you ;)

from gatsby-plugin-webpack-bundle-analyser-v2.

thecodingwizard avatar thecodingwizard commented on September 27, 2024

Awesome, thanks for looking into this! Your suggestions worked wonderfully for me :)

from gatsby-plugin-webpack-bundle-analyser-v2.

ceboola avatar ceboola commented on September 27, 2024

any news on that topic? getting same on v1.1.22 in dev mode

from gatsby-plugin-webpack-bundle-analyser-v2.

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.