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

Netlify deploy failing #9

Closed
zzrez opened this issue May 1, 2020 · 1 comment
Closed

Netlify deploy failing #9

zzrez opened this issue May 1, 2020 · 1 comment

Comments

@zzrez
Copy link

zzrez commented May 1, 2020

Hi, I clicked the green Deploy to Netlify button, and it failed. In the Netlify control panel I then clicked to try Deploy again, with cache removal. Same result. In both cases this was the error message Netlify gave:-
5:23:23 PM: error "gatsby-plugin-netlify-cms" threw an error while running the onCreateWebpackConfig lifecycle:
5:23:23 PM: Module not found: Error: Can't resolve 'fs' in '/opt/build/repo/node_modules/@babel/core/lib/transformation'
5:23:23 PM: ModuleNotFoundError: Module not found: Error: Can't resolve 'fs' in '/opt/buil d/repo/node_modules/@babel/core/lib/transformation'
A pity as I wanted to study the NetlifyCMS settings.

@l3aconator
Copy link

This is a hack but the issue is MDX run time, and you need to set node: { fs: 'empty' } in gatsby-confg.js. See here:

mdx-js/mdx#913
webpack-contrib/css-loader#447 (comment)
gatsbyjs/gatsby#10326 (comment) <- this is the issue, but you need to modify the plugins config NOT your local config, they are separate. here is the hack below:

{
      resolve: `gatsby-plugin-netlify-cms`,
      options: {
        modulePath: `${__dirname}/src/cms/cms.js`, // for custom preview in the Netlify CMS
        customizeWebpackConfig: (config) => (config.node.fs = 'empty'),
      },
    }

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

No branches or pull requests

3 participants