Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create build with webpack, show's this WebpackError: window is not defined #1453

Open
dDatwani opened this issue Nov 9, 2018 · 2 comments

Comments

@dDatwani
Copy link

dDatwani commented Nov 9, 2018

My issue is with webpack build. As i am using getsby js, and generating build i got this error

error Building static HTML for pages failed
See our docs page on debugging HTML builds for help https://goo.gl/yL9lND
}( window, function factory( window, Outlayer, getSize, matchesSelector, utils,
Item, LayoutMode ) {
isotope.js:59 Object.__WEBPACK_AMD_DEFINE_FACTORY__

The documentation of getsby js suggest me to add null-loader but seems it is not even working for me.
Is there any one who have face the same issue

@desandro
Copy link
Member

Looks like you're running into an issue with your Gatsby js implementation. Sorry I don't have a solution.

@exil0867
Copy link

exil0867 commented Jul 1, 2022

Add this to your gatsby-node.js file:

exports.onCreateWebpackConfig = ({ stage, loaders, actions }) => {
  if (stage === 'build-html' || stage === 'develop-html') {
    actions.setWebpackConfig({
      module: {
        rules: [
          {
            test: /isotope-layout/,
            use: loaders.null(),
          },
        ],
      },
    })
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants