Posts are not generated in production mode
See original GitHub issueHello 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:
- Created 5 years ago
- Comments:6
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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.
@anagstef Ignore my last message, on a fresh install, I see the same bug locally. Investigating now.