question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Posts are not generated in production mode

See original GitHub issue

Hello everyone!

Everything works fine in dev environment (gatsby develop) but when I build for production there is an issue. When I run gatsby build and then gatsby serve every post page is not generated. You can’t open any post, you get a 404.

In fact at build time it prints this warning:

warning The GraphQL query in the non-page component "/Users/anagstef/repos/test-gatsby-build/src/templates/post.js" will not be run.
Exported queries are only executed for Page components. Instead of an exported
query, either co-locate a GraphQL fragment and compose that fragment into the
query (or other fragment) of the top-level page that renders this component, or
use a <StaticQuery> in this component. For more info on fragments and
composition, see http://graphql.org/learn/queries/#fragments and for more
information on <StaticQuery>, see https://next.gatsbyjs.org/docs/static-query

Happy to help with this, if I can do it (I have no experience with GraphQL).

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
chmaccommented, Nov 30, 2018

@anagstef Arg, bug was in 638379a42d0829f1eba71433ada5fadd10206822. Added filtering but forgot to add the required field for the filter. The fix is one line in ef8ccc14185c34a09383110dc3f2e572c6e0ca46.

Hopefully that change works. I’ll close this issue now, but if it doesn’t, please reopen and I’ll look again. Thanks for taking the time to report the issue, I appreciate it.

1reaction
chmaccommented, Nov 30, 2018

@anagstef Ignore my last message, on a fresh install, I see the same bug locally. Investigating now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

npm - @nuxt/content pages not found in production mode
Create a project : npx create-nuxt-app content-project && cd content-project You have my configuration below. · Go into the project then install ...
Read more >
magento2 - In production mode the site does not load
In production mode, Magento doesn't generate any files; instead, it expects you to manually run bin/magento setup:di:compile and bin/magento ...
Read more >
Solved: production mode not working - Magento Forums
It's not a solution. composer install creates .regenerate file in var directory. Next openning a page Magento will clear generated folder.
Read more >
Production Mode doesn't work while everthing works well in ...
After I want package them in the Production mode, I found some Polymer component written by myself doesn't work. but some of them...
Read more >
All apps must be set to Live Mode for production use
Starting October 23, 2019, all apps must be set to Live Mode for production use.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found