Netlify Dev - different file paths when deployed


I have a Netlify function which makes use of file I upload next to function file.

This works only in production:

const credentials_path = './src/functions/create_project/credentials.json'

But when testing locally with Netlify Dev, I have to remove src from the path above. This works only on localhost:
const credentials_path = './functions/create_project/credentials.json'

Is it possible to unify file path in both environments?

Hey there,
Netlify Dev bundles functions differently than we do when you deploy to Netlify. You may want to chime in on this related issue on the CLI, or open a new feature request if you feel it’s different enough from this one:

1 Like