-
Notifications
You must be signed in to change notification settings - Fork 78
Open
Description
Reproduction repository: https://github.com/kotering/script-youtube-player-issue-repro
ScriptYouTubePlayer self-closing tag affects definePageMeta
Summary
- In a Nuxt page component, using
<ScriptYouTubePlayer ... />can causedefinePageMetato behave as if not applied. - Changing only the markup to
<ScriptYouTubePlayer ...></ScriptYouTubePlayer>restores normal behavior. - The same page script is unchanged.
Environment
- Nuxt:
4.3.1 - Vue:
3.5.28 @nuxt/scripts:0.13.2- Reproduced in local
nuxt dev.
Reproduction (in this repository)
- Start dev server.
- Open:
/self-closing(self-closing tag)/expanded(expanded tag)
- Compare behavior of
definePageMeta(layout: 'dark',props: { color: 'red' }).
Repro components
- Self-closing:
app/pages/self-closing.vue
- Expanded:
app/pages/expanded.vue
Expected
- Both syntaxes should be equivalent in Vue SFC templates.
definePageMetashould apply identically.
Actual
- Self-closing syntax may result in page meta/layout behavior differences.
- Expanded syntax works as expected.
Hypothesis
- With
<ScriptYouTubePlayer ... />,definePageMetaseems to be dropped during route generation for that page. - In generated routes, the expanded version includes route
meta/props, while the self-closing version does not. - This suggests a compile/transform issue around
@nuxt/scripts+ self-closing syntax, rather than runtime navigation differences.
Notes
LazyScriptYouTubePlayerappears less likely to reproduce this specific behavior in the same environment.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels