You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi. I am trying to make modular gatsby project. I have site with multiple pages, and I want to separate pages to npm modules
Right now I have this
Structure
root
module-1
module-2
module-1
It is gatsby plugin with gatsby-plugin-page-creator in gatsby-config
Its npm package compiled with babel-preset-gatsby
This plugin has the folder with pages, every page is regular page with graphql query and react component
root
Its gatsby app with module1, module2 in gatsby-config
This app doesn`t have any pages, the main goal is connect modules each other and build application
Problem
During compile root application, I have this error:
WebpackError: It appears like Gatsby is misconfigured. Gatsby related graphql calls are supposed to only be evaluated at compile time, and then compiled away. Unfortunately, something went wrong and the query was left in the compiled
code.
Can you explain me, is it good way to modular application?
Can I use plugins to separate pages to modules or creating pages inside plugins is bad idea?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi. I am trying to make modular gatsby project. I have site with multiple pages, and I want to separate pages to npm modules
Right now I have this
Structure
module-1
It is gatsby plugin with gatsby-plugin-page-creator in gatsby-config
Its npm package compiled with babel-preset-gatsby
This plugin has the folder with pages, every page is regular page with graphql query and react component
root
Its gatsby app with module1, module2 in gatsby-config
This app doesn`t have any pages, the main goal is connect modules each other and build application
Problem
During compile root application, I have this error:
Can you explain me, is it good way to modular application?
Can I use plugins to separate pages to modules or creating pages inside plugins is bad idea?
Beta Was this translation helpful? Give feedback.
All reactions