When I use process.cwd() to get a CSV file, if this part of code is in server actions, the bundler will not correctly bundle the target CSV file. In Vercel it will raise a file not found runtime error.
If this code in the normal page router api route or app router API route, it works fine.
Hi @bxclib2, after digging in deeper and help from our team. I was able to solve this issue by using the outputFileTracingIncludes option to explicitly include the data directory:
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
/* config options here */
outputFileTracingIncludes: {
'/': ['./src/data/*']
}
};