Skip to content

fix(nuxt): use portal to sync nitro/nuxt runtimeConfig + routeRules#27596

Merged
danielroe merged 1 commit intomainfrom
fix/runtime-config-sync
Jun 13, 2024
Merged

fix(nuxt): use portal to sync nitro/nuxt runtimeConfig + routeRules#27596
danielroe merged 1 commit intomainfrom
fix/runtime-config-sync

Conversation

@danielroe
Copy link
Copy Markdown
Member

🔗 Linked issue

resolves #27589

📚 Description

As a result of the refactor to runtimeConfig in #27117, it was possible to 'detach' these values if overwriting nuxt.options.runtimeConfig.

This PR first prevents overwriting nitro option (forcing Object.assign) and then also configures runtimeConfig and routeRules so they will always be kept in sync.

We might consider porting to untyped.

@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@danielroe danielroe requested a review from pi0 June 13, 2024 17:27
Copy link
Copy Markdown
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice idea!

(re untyped, i was thinking of portal support since early versions but not sure how repeated this pattern is and honestly I'm not investing much on it nowadays)

@toniengelhardt
Copy link
Copy Markdown
Contributor

toniengelhardt commented Jun 16, 2024

Hey @danielroe, you pointed me to this issue from here, but I still see the errors when I build with v3.12.2. In v3.11.x it worked fine...

Should I report this in nuxt-og-image ?

Screenshot 2024-06-16 at 14 00 03

@danielroe
Copy link
Copy Markdown
Member Author

@toniengelhardt Would you open an issue with a reproduction on nuxt/nuxt?

@toniengelhardt
Copy link
Copy Markdown
Contributor

toniengelhardt commented Jun 16, 2024

@toniengelhardt Would you open an issue with a reproduction on nuxt/nuxt?

I tried to make a reproduction and realized that the error is actually caused by unocss/nuxt@0.61.0. There seems to be a type error where inline-block is not valid, which breaks satori and as a result the pre-renderer.

I'll open an issue there 🙏🏽

Update:
It seems like inline-block just isn't allowed with unocss and satori. Not sure why it worked before, but removing it from my templates resolved the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@bg-dev/nuxt-directus not working with Nuxt 3.12.2

3 participants