-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Having a +server.js file caused 405 #11794
Description
Describe the bug
I had an on-going issue with meta-tags not rendering on social platforms, as well as possible indexing problems.
One of my pages was returning 405- even though there was nothing unusual about it.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head>
<body><p>GET method not allowed</p></body>
</html>
For example:
https://colorschemer.com/schemes returns 405
https://colorschemer.com/schemes/red worked fine
I was using Facebook debugger to test changes
I ended up trying different deployment solutions, going in circles with configurations, and playing with rendering options. In the end, the problem was just the presence of the +server.js file
Directory structure was:
- /schemes
- [slug]
- +server.js
- layout, page, etc
The file had
// export const prerender = true;
// export const ssr = true;
I would try uncommenting one at at time, but ultimately, just removing it fixed the problem
Reproduction
Put an empty +server.js file, deploy and test with Facebook debugger
Logs
No response
System Info
Netlify buildSeverity
annoyance
Additional Information
No response