Gatsby 5 upgrade error

API ID 28b292cc-063e-4f62-a3d5-230ccafb0de1

Base directory Not set
Build command npm run build
Publish directory public
Build status Active

I’m upgrading a client’s site from Gatsby 4 to Gatsby 5.
I’ve upgraded all packages to the most recent versions.

I had no errors prior to the update.

I’m getting a build error on Netlify that I do not get in my local environment.

I’ve added NODE_VERSION as an environment variable to use v18.12.1

I added gatsby-plugin-netlify but that didn’t help.

Any ideas?

Build settings:

Deploy Log:

Solution here:

But, Gatsby 5 won’t work on Netlify at the moment, at least not if you’re planning to use any of the SSR, DSG routes. If you’re planning to use just a static export, you should remove the Gatsby plugin that will probably be auto-installed.

The problem is that, our build system currently does not support build plugins with Node 18 and Gatsby 5 doesn’t support Node 16. For SSR and DSG routes, you would need the Netlify <-> Gatsby build plugin.

I appreciate your prompt response. I’ll revert until such time as you are able to support Gatsby 5.

1 Like

Thanks for letting us know! Don’t hesitate to reach out if you have any additional questions.

Hi, I have the same situation. I upgraded my project from Gatsby 4 to Gatsby 5 and the build fails.

I would like to know if there are plans that Gatsby 5 would be supported in Netlify. Thanks

Node 18 support in builds is currently being tested on random accounts and should be rolled out to everyone soon. That should allow Gatsby 5 support.

1 Like

Can I volunteer my account for this? :slight_smile: This is really a big deal of a blocker as it’s not just Gatsby 5 this affects but also the latest 4.x

Where should one go to receive updates on when this is rolled out?

When? Keep me posted, please

Sure. Could you share the site name?

Considering this thread is gathering enough attention, I think we would try to post an update here. But other than that, I don’t think we have any “plans” as such to announce this. Node 18 support end up being a silent update, but chances are, we would publish a blog post for Gatsby 5 support.

that would be appreciated.

npm remove @netlify/plugin-gatsby works here

@hrishikesh I would love to know if Node 18 + Gatsby 5 support in Netlify.

Also would like to know if removing @netlify/plugin-gatsby would help the build, as mentioned by @DomingosLed . Thanks

Hey @winstonma ! It looks like both Gatsby plugins now have support for Gatsby v5. You can see the latest releases here:

If you update these on your site(s) and are still seeing an issue, please let us know!

Thanks @amelia

Just one thing I would like to ask. I saw that there are two plugins and I am using gatsby-plugin-netlify now. I would like to know when should I use the second plugin? Thanks

These docs should clear up any confusion, based on your use case:

Please let me know if not!

Can I also volunteer my site for this, please? It’s critical for a new site launch. Thank you.

Site name: lemonadecreative

hi @matthewamundson

We’ve already rolled out node18 support. Just update the NODE_VERSION variable to 18 as seen here:

Hope this helps :slight_smile:

NODE_VERSION = 18.12.1
NPM_FLAGS = --legacy-peer-deps
This did it for me. I’ve been successfully deploying Gatsby 5 for a couple months now.

1 Like