-
Hi, I'm having issues accessing the files in the
I need to have Running the server on fs.readFileSync('public/50x90/pc_001.ts') works fine.. but once deployed on vercel, this path fails Based on the I've also tried accessing (I know I could just copy the images to the server folder, but has quite a few images in it and I want to avoid duplicating them.) Does anyone know how I could access those files? (Currently using nextJS v.12.0.7) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If someone stumbles into this with the same issue, I've managed to access the files in the public folder from inside a serverless function using const imgPath = path.join(process.cwd(), 'public', '90x50/pc_001jpg'); |
Beta Was this translation helpful? Give feedback.
If someone stumbles into this with the same issue, I've managed to access the files in the public folder from inside a serverless function using
process.cwd()
in the path: