-
DescriptionHello, i developed a gatsby site then modified it to be a theme. I successfully followed docs and videos on how to set up yarn workspaces for developing it and made all necessary changes in gatsby-config.js and package.json. Steps to reproduceJust start a new gatsby project with Expected resultThe site should build correctly and without issues, just like with local yarn workspaces build. Actual resultI got errors related to babel:
Same error is also on all page and templates files. Environment
I tried turning the theme back to a standard gatsby site and building it gives no errors, so i think this is related somehow to node_modules and dependencies issues when adding the theme to a site. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Solved it by restarting from scratch. I followed the guide on gatsby tutorial building a theme and then once i set up the workspaces and package.json files, i installed all dependencies of the gatsby site i wanted to become a theme and copied all its files in the newly created theme directory. |
Beta Was this translation helpful? Give feedback.
-
I have what seems like the exact same problem, except restarting it from scratch didn't work for me. Did you ever come across this again? I'm also building a theme. Within Yarn Workspaces everything works great. It's only when I use the theme as a plugin (not local) that I start to experience the error. It's happening for me both using Gatsby v2 and v3. |
Beta Was this translation helpful? Give feedback.
Solved it by restarting from scratch. I followed the guide on gatsby tutorial building a theme and then once i set up the workspaces and package.json files, i installed all dependencies of the gatsby site i wanted to become a theme and copied all its files in the newly created theme directory.