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

gatsby-plugin-netlify-cms error transitioning to v2 (Cannot find module @babel/runtime/helpers/interopRequireDefault) #7443

Closed
pfftdammitchris opened this issue Aug 18, 2018 · 4 comments

Comments

@pfftdammitchris
Copy link

pfftdammitchris commented Aug 18, 2018

Description

This error happens immediately with gatsby-plugin-netlify-cms:

image

Steps to reproduce

I migrated from gatsby v1 to v2 and installed the latest netlify-cms gatsby plugin: gatsby-plugin-netlify-cms@next

Expected result

It should run

Actual result

image

Continued error:

image

Environment

image

File contents (if changed)

gatsby-config.js
module.exports = {
  siteMetadata: {
    siteName: '*censored*',
    siteUrl: '*censored*',
    siteTitle:
      '*censored*',
    siteDescription:
      '*censored*',
    siteLogo: '/src/images/logo/logo.png',
    remoteLogo:
      'https://s3-us-west-1.amazonaws.com/*censored*/app/logo.png',
  },
  plugins: [
    'gatsby-plugin-react-helmet',
    'gatsby-transformer-sharp',
    'gatsby-plugin-sharp',
    'gatsby-transformer-json',
    'gatsby-plugin-remove-trailing-slashes',
    'gatsby-plugin-offline',
    {
      resolve: 'gatsby-plugin-manifest',
      options: {
        name: '*censored*',
        short_name: '*censored*',
        start_url: '/',
        background_color: '#663399',
        theme_color: '#663399',
        display: 'minimal-ui',
        icon: 'src/images/favicon/favicon-32x32.png', // This path is relative to the root of the site.
      },
    },
    {
      resolve: 'gatsby-transformer-remark',
      options: {
        plugins: [
          {
            resolve: 'gatsby-remark-embed-video',
            options: {
              width: 800,
              height: 500, // Optional: Overrides optional.ratio
              ratio: 1.77, // Optional: Defaults to 16/9 = 1.77
              related: false, //Optional: Will remove related videos from the end of an embedded YouTube video.
            },
          },
          'gatsby-remark-responsive-iframe',
        ],
      },
    },
    {
      resolve: 'gatsby-plugin-netlify-cms',
      options: {
        modulePath: `${__dirname}/src/cms/cms.js`,
      },
    },
    {
      resolve: 'gatsby-plugin-google-fonts',
      options: {
        fonts: ['Roboto:300,400,500', 'Ruthie'],
      },
    },
    {
      resolve: 'gatsby-source-filesystem',
      options: {
        name: 'pages',
        path: `${__dirname}/src/pages/`,
      },
    },
    {
      resolve: 'gatsby-source-filesystem',
      options: {
        name: 'data',
        path: `${__dirname}/src/data/`,
      },
    },
    {
      resolve: 'gatsby-source-filesystem',
      options: {
        name: 'images',
        path: `${__dirname}/src/images`,
      },
    },
    {
      resolve: 'gatsby-source-filesystem',
      options: {
        name: 'staticImages',
        path: `${__dirname}/static/images`,
      },
    },
    {
      resolve: 'gatsby-plugin-sitemap',
      options: {
        output: '/sitemap.xml',
        exclude: ['/privacy-policy'],
        query: `
          {
            site {
              siteMetadata {
                siteUrl
              }
            }
            allSitePage {
              edges {
                node {
                  path
                }
              }
            }
          }
        `,
      },
    },
    {
      resolve: 'gatsby-plugin-google-analytics',
      options: {
        trackingId: process.env.GOOGLE_ANALYTICS_ID,
      },
    },
    {
      resolve: 'gatsby-plugin-react-svg',
      options: {
        include: /svg/,
      },
    },
  ],
}
package.json
{
  "name": "*censored*",
  "description": "*censored*",
  "version": "1.0.0",
  "author": "*censored*",
  "keywords": [
    "wl"
  ],
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "https://github.com/gatsbyjs/gatsby-starter-default"
  },
  "scripts": {
    "build": "gatsby build",
    "start": "gatsby develop -p 3000",
    "format": "prettier --write src/**/*.js",
    "test": "jest --colors --config jest.config.js --no-cache",
    "test:watch": "jest --watch --colors --config jest.config.js --no-cache",
    "git": "git add . && git commit -m \"Update\" && git push"
  },
  "dependencies": {
    "@material-ui/core": "^1.5.0",
    "aws-sdk": "^2.296.0",
    "axios": "^0.18.0",
    "classnames": "^2.2.6",
    "dotenv": "^6.0.0",
    "gatsby": "next",
    "gatsby-paginate": "^1.0.16",
    "gatsby-plugin-feed": "^1.3.25",
    "gatsby-plugin-google-analytics": "^1.0.31",
    "gatsby-plugin-google-fonts": "0.0.4",
    "gatsby-plugin-manifest": "next",
    "gatsby-plugin-netlify-cms": "^3.0.0-beta.4",
    "gatsby-plugin-offline": "next",
    "gatsby-plugin-react-helmet": "next",
    "gatsby-plugin-react-svg": "^1.1.1",
    "gatsby-plugin-sharp": "^1.6.48",
    "gatsby-plugin-sitemap": "^1.2.25",
    "gatsby-remark-embed-video": "^1.4.0",
    "gatsby-remark-responsive-iframe": "^1.4.20",
    "gatsby-source-filesystem": "^1.5.39",
    "gatsby-transformer-json": "^1.0.20",
    "gatsby-transformer-remark": "^1.7.44",
    "gatsby-transformer-sharp": "^1.6.27",
    "html-to-text": "^4.0.0",
    "jss": "^9.8.7",
    "moment": "^2.22.2",
    "netlify-cms": "^2.0.9",
    "nuka-carousel": "^4.3.6",
    "qs": "^6.5.2",
    "rc-pagination": "^1.16.5",
    "react": "^16.4.2",
    "react-circular-progressbar": "^1.0.0",
    "react-dom": "^16.4.2",
    "react-headroom": "^2.2.2",
    "react-helmet": "^5.2.0",
    "react-icons": "^3.0.5",
    "react-jss": "^8.6.1",
    "react-lazyload": "^2.3.0",
    "react-redux": "^5.0.7",
    "react-router-hash-link": "^1.2.0",
    "react-share": "^2.3.0",
    "react-slick": "^0.23.1",
    "react-virtualized": "^9.20.1",
    "recompose": "^0.28.2",
    "redux": "^4.0.0",
    "redux-devtools-extension": "^2.13.5",
    "redux-form": "^7.4.2",
    "redux-logger": "^3.0.6",
    "redux-thunk": "^2.3.0",
    "slick-carousel": "^1.8.1"
  },
  "devDependencies": {
    "@babel/core": "^7.0.0-rc.1",
    "@babel/plugin-proposal-class-properties": "^7.0.0-rc.1",
    "@babel/plugin-syntax-dynamic-import": "^7.0.0-rc.1",
    "@babel/plugin-transform-runtime": "^7.0.0-rc.1",
    "@babel/preset-env": "^7.0.0-rc.1",
    "@babel/preset-flow": "^7.0.0-rc.1",
    "@babel/preset-react": "^7.0.0-rc.1",
    "babel-eslint": "^8.2.6",
    "babel-jest": "^23.4.2",
    "babel-loader": "^7.1.5",
    "babel-plugin-macros": "^2.4.0",
    "babel-plugin-module-resolver": "^3.1.1",
    "enzyme": "^3.4.4",
    "enzyme-adapter-react-16": "^1.2.0",
    "enzyme-to-json": "^3.3.4",
    "eslint": "^5.4.0",
    "eslint-config-airbnb": "^17.1.0",
    "eslint-config-prettier": "^3.0.1",
    "eslint-plugin-import": "^2.14.0",
    "eslint-plugin-jsx-a11y": "^6.1.1",
    "eslint-plugin-prettier": "^2.6.2",
    "eslint-plugin-react": "^7.11.1",
    "gatsby-plugin-remove-trailing-slashes": "^1.0.9",
    "gatsby-plugin-webpack-bundle-analyzer": "^0.1.1",
    "jest": "^23.5.0",
    "prettier": "^1.14.2",
    "prettier-eslint": "^8.8.2"
  },
  "jest": {
    "snapshotSerializers": [
      "enzyme-to-json/serializer"
    ],
    "transform": {
      ".(js|jsx)": "babel-jest"
    },
    "testRegex": "(\\.(test|spec))\\.(jsx|js)$",
    "testPathIgnorePatterns": [
      "/node_modules/",
      "/.cache/"
    ],
    "moduleFileExtensions": [
      "jsx",
      "js"
    ],
    "setupTestFrameworkScriptFile": "<rootDir>/src/_tests/setupTests.js"
  }
}

gatsby-node.js

Empty (nothing changed/added)

gatsby-browser.js

Empty (nothing changed/added)

gatsby-ssr.js

Empty (nothing changed/added)

@pfftdammitchris
Copy link
Author

I've tried npm install @babel/runtime but I had to remove it since it was giving a new error that some node_modules/@babel/runtime/helpers/objectWithoutLooseProperties.js file wasn't to be found even though it's clearly there.

Spent over an hour and a half trying to fix this problem and I came to the conclusion that I am no match for this devasting error. So is google

@azdanov
Copy link
Contributor

azdanov commented Aug 18, 2018

Could you share a link to the repository?

All I can think of it that /static/admin/config.yml, modulePath: ${__dirname}/src/cms/cms.js or node_modules itself have some issues.

EDIT:

Some of your other gatsby-plugins are for v1. Maybe they are responsible for messing things up.

@HriBB
Copy link

HriBB commented Aug 25, 2018

@ryan258
Copy link

ryan258 commented Nov 21, 2018

@pfftdammitchris I ran into the same issue, I gave this a try and I'm back to moving forward.
npm install uglifyjs-webpack-plugin

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

4 participants