Skip to content

use c12 in production (netlify) #2986

@ayoayco

Description

@ayoayco

Environment

Nitro: 2.10.4 (latest)
Node: 22.12.0

Reproduction

Repo: https://github.com/ayoayco/nitro-c12-netlify-reproduction
StackBlitz: https://stackblitz.com/edit/github-aluadpqs?file=nitro.config.ts
Netlify Build: https://app.netlify.com/sites/lively-sunflower-e3c342/deploys/67817d1b9227bb0008480b85

Describe the bug

I am using c12 loadConfig from inside a nitro middleware and it is working okay both on dev and default node-server presets; however when deployed to netlify it is not getting the configuration.

My hunch is that the config file is not in the netlify build. Apologies if this is not a bug and documented somewhere, I couldn't find how to work it out.

I'm willing to work on an improvement/fix/doc for this if someone can point to a good direction

Screenshots

node-server build
Screenshot from 2025-01-10 21-04-03

dev server
Screenshot from 2025-01-10 21-04-28

netlify (prod) function
Screenshot from 2025-01-10 21-06-54

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions