[SOLVED] ETH Boilerplate - Request failed with status code 400 on Netlify

Hello, my app (based on the ETH Boilerplate) is perfectly working when I use it in localhost but once I put it online (on netlify), I have the following error every time I push the “connect wallet” button:
" Oops, something went wrong…Request failed with status code 400".
In the console " Failed to load resource: the server responded with a status of 400 ()". I think that it’s something connected to the environnement variables (and the Moralis Api Key) but I checked many times and they are exactly the same in both case. So what could be the issue?

Hi @Deckard

Do you see any server error logs on netlify? It could give more details on the issue

The netlify logs are showing me the following when I click on the connect wallet button:

Blockquote
Feb 2, 03:16:32 PM: INIT_START Runtime Version: nodejs:18.v20 Runtime Version ARN: arn:aws:lambda:us-east-2::runtime:a993d90ea43647b82f490a45d7ddd96b557b916a30128d9dcab5f4972911ec0f
Feb 2, 03:16:34 PM: 394a0a46 INFO [GET] /api/auth/session (SSR)
Feb 2, 03:16:34 PM: 394a0a46 Duration: 1420.56 ms Memory Usage: 160 MB Init Duration: 605.55 ms
Feb 2, 03:16:34 PM: 3c163938 INFO [GET] /api/auth/session (SSR)
Feb 2, 03:16:34 PM: 3c163938 Duration: 62.56 ms Memory Usage: 160 MB
Feb 2, 03:16:41 PM: 44b4103d INFO [POST] /api/moralis/auth/requestChallengeEvm (SSR)
Feb 2, 03:16:41 PM: 44b4103d Duration: 2945.81 ms Memory Usage: 232 MB

Thanks, I found the solution. I changed the Netlify environment Node version to 16.13.0 and now it’s working!

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.