Next.js Discord

Discord Forum

Vercel - Next js Error on write

Unanswered
Brown bear posted this in #help-forum
Open in Discord
Brown bearOP
Hi everyone I am using a library that allows me to use mdx files and create static pages
I have created a cms with this library that by creating new files, allows me to have new pages.

I uploaded on vercel, my app in nextjs but it tells me that I don't have permissions to do the write how can I solve this problem?

8 Replies

Brown bearOP
Yes I also save it in the database but to create the static pages I need this file...
Otherwise I wouldn't know how to do it
to create the static pages I need this file
no you don't – you can always store the file content in a db and read it because your databases are writable, but you cannot do that for the vercel fs because it is not writable (due to the serverless architecture). if you need to host where the fs is writable, you need to get a running server as serverless is not compatible with that
Brown bearOP
You say save it in an aws bucket and read it from there to use a serveless server?
i say that vercel fs is not writable so you need to write that to somewhere else. you choose - a db works, aws s3 works, anything that can store data will work
Brown bearOP
I just don't know if the library is compatible I am using contentlayer it allows me to read files inside a bucket