datocms / gatsby-source-datocms

Official GatsbyJS source plugin to pull content from DatoCMS
MIT License
140 stars 50 forks source link

GraphQL Error Unknown type "DatoCmsFixed". #73

Closed joebentaylor closed 5 years ago

joebentaylor commented 5 years ago

Ive just updated all of my npm packages and now i cant seem to run my project anymore... Ive not even got the point where i need to hookup dato to my project yet, so im not sure why this plugin is causing such an issue

error i get when running gatsby develop :

GraphQL Error Unknown type "DatoCmsFixed".

  file: /Users/joetaylor/Documents/www/colorworld/node_modules/gatsby-source-datocms/src/assetFragments.js

  1 | 
> 2 |   fragment GatsbyDatoCmsResolutions on DatoCmsFixed {
    |                                        ^
  3 |     base64
  4 |     width
  5 |     height
  6 |     src
  7 |     srcSet
  8 |   }
  9 | 
LucaVerdecchia commented 5 years ago

I confirm, same error.

matjack1 commented 5 years ago

@joebentaylor were you able to solve the issue in the end? I cannot recall how we dealt with this in the end, can you remind me please, I've been on holidays meanwhile :)

b-reklass commented 5 years ago

For anyone with this issue-- you may have had the same problem I did. The

apiUrl: 'https://site-api.datocms.com',

Configuration the docs has by default will mess up your config. When the plugin doesn't successfully run, it'll cause the GraphQL errors above. You'll need to make sure your plugin is resolving correctly.

matjack1 commented 5 years ago

@b-reklass what did you use instead? I can fix the docs!

b-reklass commented 5 years ago

@matjack1 I actually just left out the apiUrl altogether and it compiled correctly!

matjack1 commented 5 years ago

that's weird @b-reklass as that value is the default somewhere else. I mean, it could be left out as a default, but I'm not sure how that can be the source of your issue.

Can anyone else replicate? @joebentaylor ?

RoelVanderPaal commented 5 years ago

Going back to gatsby 2.11.x solves this problem for me. Might it be related to this?: https://github.com/gatsbyjs/gatsby/issues/15344#issuecomment-520151776

joebentaylor1995 commented 5 years ago

Still getting this problem, not sure how to fix

matjack1 commented 5 years ago

@joebentaylor can you please share your versions of gatsby, gatsby-source-datocms and datocms-client? Also your Node.js version can be useful. I'll try replicating myself.

joebentaylor1995 commented 5 years ago

@matjack1

{
    "name": "tackl",
    "description": "Tackl Starter Kit - Gatsby",
    "version": "4.1.0",
    "author": "Joe Taylor <joebentaylor1995@icloud.com>",
    "dependencies": {
        "@hot-loader/react-dom": "^16.8.6",
        "autoprefixer": "^9.5.1",
        "babel-plugin-styled-components": "^1.10.0",
        "classnames": "^2.2.6",
        "css-loader": "^3.2.0",
        "dangerously-set-inner-html": "^2.0.1",
        "eslint-plugin-prettier": "^3.0.1",
        "flickity": "^2.2.0",
        "gatsby": "^2.3.23",
        "gatsby-image": "^2.0.39",
        "gatsby-plugin-alias-imports": "^1.0.5",
        "gatsby-plugin-layout": "^1.0.14",
        "gatsby-plugin-manifest": "^2.0.29",
        "gatsby-plugin-netlify": "^2.0.13",
        "gatsby-plugin-offline": "^2.0.25",
        "gatsby-plugin-postcss": "^2.0.7",
        "gatsby-plugin-postcss-sass": "^1.0.22",
        "gatsby-plugin-react-helmet": "^3.0.12",
        "gatsby-plugin-robots-txt": "^1.3.0",
        "gatsby-plugin-sass": "^2.0.11",
        "gatsby-plugin-sharp": "^2.0.34",
        "gatsby-plugin-styled-components": "^3.0.7",
        "gatsby-plugin-transition-link": "^1.12.2",
        "gatsby-plugin-webpack-bundle-analyzer": "^1.0.4",
        "gatsby-remark-prettier": "^1.0.0",
        "gatsby-remark-prismjs": "^3.2.8",
        "gatsby-source-filesystem": "^2.0.29",
        "gatsby-transformer-remark": "^2.3.8",
        "gatsby-transformer-sharp": "^2.1.18",
        "gsap": "^2.1.2",
        "headroom.js": "^0.9.4",
        "history": "4.9.0",
        "hover": "^3.0.0-alpha.6",
        "imagesloaded": "^4.1.4",
        "mobx": "^5.9.4",
        "mobx-react": "^6.1.3",
        "postcss-focus": "4.0.0",
        "react": "^16.8.6",
        "react-dom": "^16.8.6",
        "react-flickity-component": "^3.1.0",
        "react-helmet": "^5.2.0",
        "react-load-script": "0.0.6",
        "react-pure-lifecycle": "^3.0.0",
        "react-router-dom": "^5.0.0",
        "react-socks": "^2.0.2",
        "sass-loader": "^8.0.0",
        "styled-components": "^4.2.0",
        "styled-normalize": "^8.0.6",
        "window-or-global": "^1.0.1"
    },
    "keywords": [
        "gatsby"
    ],
    "license": "MIT",
    "scripts": {
        "build": "gatsby build",
        "develop": "gatsby develop",
        "format": "prettier --write '**/*.js'",
        "test": "echo \"Error: no test specified\" && exit 1"
    },
    "devDependencies": {
        "imports-loader": "^0.8.0",
        "prettier": "^1.17.0"
    },
    "repository": {
        "type": "git",
        "url": "https://github.com/gatsbyjs/gatsby-starter-default"
    }
}

Ive had to take the package out for now to stop the error, but the latest version would have been in there.

also on anther note @matjack1 I can no longer login to dato, can you email me on joebentaylor1995@icloud.com so i can explain?

matjack1 commented 5 years ago

I'm very sorry @joebentaylor for the delay in getting back to you but I cannot replicate your issue here.

If you are still interested, maybe can you invite me to your project so that I can try myself?

I'm going to close this for now, but feel free to reopen if still relevant.

KyleAMathews commented 4 years ago

I ran into this same issue & it turned out you just need to comment out the apiUrl: 'https://site-api.datocms.com' bit in the default config — that wasn't obvious from looking at it so the README could be updated to do this.