TylerBarnes / gatsby-plugin-transition-link

A link component for page transitions in gatsby
537 stars 70 forks source link

build error when adding gatsby-plugin-transition-link to gatsby-config.js #171

Closed LinnJS closed 4 years ago

LinnJS commented 4 years ago

Package.json:

 {
  "name": "project-name",
  "private": true,
  "description": "description",
  "version": "0.1.0",
  "author": "author <author@gmail.com>",
  "dependencies": {
    "babel-plugin-styled-components": "^1.10.6",
    "gatsby": "^2.17.11",
    "gatsby-image": "^2.2.31",
    "gatsby-plugin-manifest": "^2.2.27",
    "gatsby-plugin-netlify-cms": "^4.1.28",
    "gatsby-plugin-offline": "^3.0.19",
    "gatsby-plugin-react-helmet": "^3.1.14",
    "gatsby-plugin-sharp": "^2.2.37",
    "gatsby-plugin-styled-components": "^3.1.12",
    "gatsby-plugin-transition-link": "^1.17.3",
    "gatsby-remark-copy-linked-files": "^2.1.30",
    "gatsby-remark-images": "^3.1.31",
    "gatsby-remark-prismjs": "^3.3.23",
    "gatsby-remark-responsive-iframe": "^2.2.27",
    "gatsby-remark-smartypants": "^2.1.16",
    "gatsby-source-filesystem": "^2.1.37",
    "gatsby-transformer-remark": "^2.6.35",
    "gatsby-transformer-sharp": "^2.3.3",
    "gsap": "^3.0.2",
    "netlify-cms-app": "^2.9.7",
    "prismjs": "^1.17.1",
    "prop-types": "^15.7.2",
    "react": "^16.11.0",
    "react-dom": "^16.11.0",
    "react-helmet": "^5.2.1",
    "styled-components": "^4.4.1"
  },
  "devDependencies": {
    "prettier": "^1.19.1"
  },
  "keywords": [
    "gatsby"
  ],
  "license": "MIT",
  "scripts": {
    "build": "gatsby build",
    "dev": "gatsby develop",
    "format": "prettier --write \"**/*.{js,jsx,json,md}\"",
    "start": "npm run develop",
    "serve": "gatsby serve",
    "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": ""
  },
  "bugs": {
    "url": ""
  }
}

Steps to reproduce:

add gatsby-plugin-transition-link to gatsby-config.js, and run yarn build

I get the following error:

image Error keywords: _ref.exitDelay of undefined gatsbyjs exitDelay WebpackError TypeError

Please help, want to use this so badly, works great in dev!!!

LinnJS commented 4 years ago

Resolution

After feeling like I was crazy for having this issue I was like hey the Steps to Reproduce are so simple why not spin up a newly generate Gatsby project, and install this module and see if I can reproduce myself. Low and behold I got no errors. So I went ahead, and installed all the same packages but fresh, and latest versions. Still no error... So I transplanted the package.json to my real project... ERRORS WENT AWAY LOLOL.

Have no idea what was mismatched but maybe someone whom knows better can give me some closure to what exactly was happening?

New package.json:

{
  "name": "project-name",
  "private": true,
  "description": "description",
  "version": "0.1.0",
  "author": "author <author@gmail.com>",
  "dependencies": {
    "babel-plugin-styled-components": "^1.10.6",
    "gatsby": "^2.18.12",
    "gatsby-image": "^2.2.34",
    "gatsby-plugin-manifest": "^2.2.31",
    "gatsby-plugin-netlify-cms": "^4.1.33",
    "gatsby-plugin-offline": "^3.0.27",
    "gatsby-plugin-react-helmet": "^3.1.16",
    "gatsby-plugin-sharp": "^2.3.5",
    "gatsby-plugin-styled-components": "^3.1.16",
    "gatsby-plugin-transition-link": "^1.17.7",
    "gatsby-remark-copy-linked-files": "^2.1.33",
    "gatsby-remark-images": "^3.1.38",
    "gatsby-remark-prismjs": "^3.3.27",
    "gatsby-remark-responsive-iframe": "^2.2.30",
    "gatsby-remark-smartypants": "^2.1.19",
    "gatsby-source-filesystem": "^2.1.40",
    "gatsby-transformer-remark": "^2.6.42",
    "gatsby-transformer-sharp": "^2.3.7",
    "gsap": "^3.0.4",
    "netlify-cms-app": "^2.9.7",
    "prismjs": "^1.17.1",
    "prop-types": "^15.7.2",
    "react": "^16.12.0",
    "react-dom": "^16.12.0",
    "react-helmet": "^5.2.1",
    "styled-components": "^4.4.1"
  },
  "devDependencies": {
    "prettier": "^1.19.1"
  },
  "keywords": [
    "gatsby"
  ],
  "license": "MIT",
  "scripts": {
    "build": "gatsby build",
    "dev": "gatsby develop",
    "format": "prettier --write \"**/*.{js,jsx,json,md}\"",
    "start": "npm run develop",
    "serve": "gatsby serve",
    "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": ""
  },
  "bugs": {
    "url": ""
  }
}
TylerBarnes commented 4 years ago

Glad you figured it out! Looks like in your first package.json you had v1.17.3 and in your updated one you have v1.17.7 Most likely you were experiencing a legitimate regression in 1.17.3 which was probably fixed by 1.17.4.

Anyway glad you got it sorted :) let me know if you run into any other issues!

TylerBarnes commented 4 years ago

Oo, a good tip for you. If you're using yarn, you can run yarn upgrade-interactive --latest to get an interactive upgrade prompt from the command line. You can use your arrow keys and spacebar to select which packages to upgrade to the latest version, and they'll be installed when you hit enter.