Next.js Discord

Discord Forum

Stop Vercel Dynamically Storing Public Files

Answered
Giant panda posted this in #help-forum
Open in Discord
Giant pandaOP
I have a 'download' button on my app, that references a PDF file in the public directory. This works fine when run locally, however when deployed to vercel it does not.

When trying to access 'http://domain.com/FILENAME' it does not work for this file, but does work for all the other image files stored in the public folder that are used in my app.

I read that Vercel does this on purpose?

Any suggestions?
Answered by Anay-208 | Ping in replies
I had to set this
    "functions": {
        "api/*": {
            "includeFiles": "docs/**/*"
        }
    }
View full answer

13 Replies

i faced this issue before with a app(it wasn't nextjs, so confirm), I had to add that path to vercel config. you can check out vercel config
I had to set this
    "functions": {
        "api/*": {
            "includeFiles": "docs/**/*"
        }
    }
Answer
I'm unsure if its same for nextjs.
Giant pandaOP
alright, cheers i appreciate the help
please verify if it is working first, and lmk
Giant pandaOP
Unfortunately not, as I have no severless functions I'm trying to reference,
Umm, I'll have to check this locally first. will do that tmr and let you know
Giant pandaOP
cheers
@Giant panda I tried it, and its working fine for me
I'm able to view the PDF after deploying to vercel
@Giant panda
@Anay-208 | Ping in replies <@297072786046844938>
Giant pandaOP
Hi - so sorry for the delay, I got this woking using your help. Thank you so much!