Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

fix(nuxt): de-default layout/component imports #7389

Merged
merged 4 commits into from Sep 10, 2022
Merged

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Sep 9, 2022

πŸ”— Linked issue

resolves nuxt/nuxt#14827, resolves nuxt/nuxt#14350

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

When we were producing a single inlined file, we were not de-defaulting the exports.

So, for example, a default layout ended up resolving to { default: /* layout */ }, triggering a warning from vue that it had no render property. (The actual render property could have been accessed on layout.default.render.)

This completely broke all inlined targets (cloudflare, vercel-edge, netlify-edge) if you were using layouts or lazy components.

Adding interop defaults resolves the issue. I've gone ahead and done the same for lazy components and custom error components which were not mentioned in the original report, but had the same buggy behaviour in my testing.

Middleware doesn't need it as it is de-defaulted at point of use.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe added bug Something isn't working ❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf labels Sep 9, 2022
@danielroe danielroe requested a review from pi0 September 9, 2022 15:42
@danielroe danielroe self-assigned this Sep 9, 2022
@netlify
Copy link

netlify bot commented Sep 9, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit ee81f84
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/631b98f99646eb0007c3e121

@danielroe danielroe marked this pull request as draft September 9, 2022 16:18
@danielroe danielroe changed the title fix(nuxt): de-default layout/component/middleware imports fix(nuxt): de-default layout/component imports Sep 9, 2022
@danielroe danielroe marked this pull request as ready for review September 9, 2022 19:50
@pi0 pi0 merged commit e60d03b into main Sep 10, 2022
@pi0 pi0 deleted the fix/dedefault-inlined branch September 10, 2022 09:41
This was referenced Sep 14, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3.x bug Something isn't working ❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf
Projects
None yet
2 participants