Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(0 , _nitropack.defineNitroPreset) is not a function #3

Open
pi0 opened this issue Jul 10, 2023 · 4 comments
Open

(0 , _nitropack.defineNitroPreset) is not a function #3

pi0 opened this issue Jul 10, 2023 · 4 comments

Comments

@pi0
Copy link
Member

pi0 commented Jul 10, 2023

It seems there is a bug with jiti/c12 loader

@peralta
Copy link

peralta commented Oct 9, 2024

Any updates? I am trying to build a custom preset in my nuxt project but the build is failing just after starting with this error.

@pi0
Copy link
Member Author

pi0 commented Oct 9, 2024

you can simply use defineNitroConfig. But please consider mentioning any issue upstream in nitro or contribute to original presets. It is likely we never officially support custom presets and start warning about them.

@peralta
Copy link

peralta commented Oct 9, 2024

Thanks for the quick response @pi0 -- I have verified that the following workaround solves the issue: https://github.com/storipress/site-generator/blob/355ce4a5526645da85b24703946a30ce12014d54/playground/nitro/nitro-preset.ts#L3

I understand the point about contributing to custom resets but, in some cases, there is a need to customize for very particular needs (in my particular example, I want to avoid 404s from hitting the server function in my netlify setup, which I doubt is worth contributing upstream).

@pi0
Copy link
Member Author

pi0 commented Oct 9, 2024

Thanks for ref. Just a heads up, this line using #internal is gonna be broken with nitro 2.10 as internal paths are updated (and can be updated again)

Also, another heads up is that the cloudflare preset is not fully compatible with Nitro yet. you will lose global access to process.env in unenv v2 that's why it was marked as experimental.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants