I have implemented Firebase storage put method to my nextJs App in order to upload pictures on Firebase Storage.
When I tested this method on my localhost, it worked like a charm but when i came to production, Firebase returned me a non verbose error :
"the server responded with a status of 405 ()"
or " cannot post 405' " on my Antd Design graphic Library
the weirdest is that response is irregular.
From the form url, it always respond this 405 error but if i try from the form component mounted in another url, it works, and in another context, sometimes it works sometimes it doesn't.
It is very hard to understand what happen and I can't find any lead on the Internet.
My NextJs App is hosted on Vercel Server and I guess all is well set up, authentication work for example but I did not try to access RTDB or Firestore.
This error is intermittent so I could imagine that is not a CORS Problem, neither a token access problem, because I tried without token access and I got an explicit error.
Thank you truly to dedicate some of your time to help me figure it out.
Have a nice day.
Example of my very "classic" method from Firebase documentation :
firebaseApp
.storage()
.ref(`pictures/${file.name}`)
.put(file.originFileObj)
.then(() => {
console.log("Picture uploaded")
})
.catch((err) => {
console.log(err.message);
});