Comments (9)
Looks like there is a malformed GraphQL query being sent.
Can you open the network tab and find the network request to graphql endpoint at prismic, copy the query and paste it here?
There is a "view source" link right next to "Request Payload" at the bottom, so it's easy to copy paste.
from gatsby-source-prismic-graphql.
Woah, thanks for super fast reponses :D
There's a request to:
https://myrepo.prismic.io/previews/token/XFgwHxEAAOQ6vymn
where the token matches the preview cookie, but it's missing a payload if that's the one that should have it?
After that it keeps pinging:
https://myrepo.prismic.io/previews/XFgwHxEAAOQ6vymn/ping?ref=https%3A%2F%2Fmyrepo.prismic.io%2Fpreviews%2FXFhIpBEAAOQ6v49D
but no payloads there either?
from gatsby-source-prismic-graphql.
Yeah, so if the query in gatsby-browser
is supposed to be a graphql parsed from the component, then that's definitely failing now, it's just that int "1826773283":
Looks like I'm doing something wrong, so I'll check out your example and try again.
from gatsby-source-prismic-graphql.
Okay, issue found... and I should have thought of this earlier: I'm using typescript. Changing my index.tsx -> index.jsx fixed the preview issue.
SInce you're using typescript in the plugin, I'm hopeful there's typescript support hidden here somewhere? :)
from gatsby-source-prismic-graphql.
Yes! Nice catch buddy! I'll update this issue tomorrow with a fix!
I am overwriting the babel loader that does not remove graphql queries (so they can be reused) and I remember a ts-plugin failed in some scenario. I'm on the phone now so let me research this a bit.
Thanks for the update!
from gatsby-source-prismic-graphql.
Could also be difference in the tsconfig / imports? I can match yours if you provide it, i'm currently using:
{
"compilerOptions": {
"declaration": true,
"emitDecoratorMetadata": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"jsx": "react",
"sourceMap": true,
"strict": true,
"target": "es5",
"baseUrl": "./src",
"module": "commonjs",
"noImplicitReturns": true,
"noImplicitThis": true,
"preserveConstEnums": true,
"removeComments": true,
"strictNullChecks": true
}
}
from gatsby-source-prismic-graphql.
I've checked a project we have that uses typescript and don't see anything that is different, however maybe the order of plugins matter. Make sure to put this plugin after typescript plugin in gatsby-config.
{
"compilerOptions": {
// Base directory to resolve non-relative module names.
"baseUrl": "./src",
// Specify module code generation
"module": "commonjs",
// Generates corresponding '.map' file.
"sourceMap": true,
// Enables experimental support for ES7 decorators.
"experimentalDecorators": true,
// Target latest version of ECMAScript.
"target": "esnext",
// Search under node_modules for non-relative imports.
"moduleResolution": "node",
// Process & infer types from .js files.
"allowJs": true,
// Don't emit; allow Babel to transform files.
"noEmit": true,
// Enable strictest settings like strictNullChecks & noImplicitAny.
"strict": true,
// Disallow features that require cross-file information for emit.
"isolatedModules": true,
// Import non-ES modules as default imports.
"esModuleInterop": true,
// Type declaration files to be included in compilation.
"types": ["node"],
// Specify library file to be included in the compilation.
"lib": ["dom", "es2015", "es2017"],
// Specify JSX code generation
"jsx": "preserve",
// Report errors on unused locals.
"noUnusedLocals": true,
// Report errors on unused parameters.
"noUnusedParameters": true,
// Do not emit comments to output.
"removeComments": false,
// Do not erase const enum declarations in generated code.
"preserveConstEnums": true
},
// Specifies a list of glob patterns that match files to be included in compilation.
"include": ["./src/**/*"]
}
from gatsby-source-prismic-graphql.
Omg! That was it! Thanks a bunch, wouldn't have realised that on my own! 🎉
Now let's hope everything else is smooth sailing :D
from gatsby-source-prismic-graphql.
Glad to help. Don't hesitate to report any more issues you have
from gatsby-source-prismic-graphql.
Related Issues (20)
- Pagination broken - prismic.load throws error HOT 1
- Cannot find module './third-party/gatsby-node' HOT 76
- Preview path incorrectly created during Gatsby build process HOT 1
- Can't get previews working HOT 5
- [bug] Node crashing when using onCreatePage HOT 1
- imageSharp returning null HOT 6
- [Solution] Prevent preview script from being downloaded if not needed
- [Feature request]: Add meta tags to be used in pages filter method HOT 1
- [Discussion]: Enable More Maintainers of the Project HOT 12
- StaticQuery is not working HOT 4
- Build failures for large images
- [BUG] Can't get more than 20 results HOT 1
- UPDATE: Statement from Prismic HOT 6
- New fields added to repeatable type not showing in project HOT 1
- Can't load more than 20 items HOT 7
- Is there a way of Generating/Using a custom index page?
- [Feature request] Add plugin option for prismic.io address
- Apollo Client in production build
- The Prismic API started including "y" HOT 1
- __typename does not match generated type
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-source-prismic-graphql.