You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Start the fixtures from Nuxt with pnpm nuxi dev ./test/fixtures/basic
go to localhost:3000/islands
see Property "t" was accessed during render but is not defined on instance. in logs
nuxt fixtures test don't pass with pnpm test
What is expected?
not having any error or warn in the console
fixtures tests should also pass
What is actually happening?
The compiled result of the SFC has a JSON.stringify($setup.__vforToArray(["fall", "back"]).map((t, index) => ({ t: _ctx.t }))
(source: JSON.stringify(__vforToArray(['fall', 'back']).map((t, index) => ({ t: t }))))
t shouldn't be prefixed with _ctx
Investigation
doing a nuxt hot reload seems to fix it
triggering 5 to 6 time HMR seems to fix it (some cache ?)
We tried to reproduce it on the SFC playground, unsuccessfully
debugging the SFC file transformation
the issue seems to be coming from @vue/compiler-sfc through @vitejs/plugin-vue
code passed to transformMain is always the same
the descriptor for the SFC file is not identical at first loading (_ctx prefix) and at nuxt hot reload or hmr.
The root cause is that the scope variable name in the scopeIds on the node have not been removed, while it is removed from the knownIds. Due to the reuse the AST, failing to add the scope variable to the knownIds in markScopeIdentifier.
Vue version
3.4-alpha.4
Link to minimal reproduction
https://github.com/nuxt/nuxt/actions/runs/7208581804/job/19637892933?pr=23998
Steps to reproduce
pnpm nuxi dev ./test/fixtures/basic
localhost:3000/islands
Property "t" was accessed during render but is not defined on instance.
in logspnpm test
What is expected?
What is actually happening?
The compiled result of the SFC has a
JSON.stringify($setup.__vforToArray(["fall", "back"]).map((t, index) => ({ t: _ctx.t }))
(source:
JSON.stringify(__vforToArray(['fall', 'back']).map((t, index) => ({ t: t })))
)t
shouldn't be prefixed with_ctx
Investigation
debugging the SFC file transformation
@vue/compiler-sfc
through@vitejs/plugin-vue
transformMain
is always the same_ctx
prefix) and at nuxt hot reload or hmr.looking for the vue core commit
Additionnal Infos
SFC source:
vite plugin vue result:
What it should be:
System Info
No response
Any additional comments?
.map((t, index) => ())
are prefixed with_ctx
cc @danielroe
The text was updated successfully, but these errors were encountered: