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

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

Merged
pi0 merged 4 commits intomainfrom
fix/dedefault-inlined
Sep 10, 2022
Merged

fix(nuxt): de-default layout/component imports#7389
pi0 merged 4 commits intomainfrom
fix/dedefault-inlined

Conversation

@danielroe
Copy link
Copy Markdown
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
Copy Markdown

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

Development

Successfully merging this pull request may close these issues.

Netlify SSR [Vue warn]: Component <Anonymous> is missing template or render function. cloudflare worker SSR issue due to bundling config problem

2 participants