F
Filamentβ€’2y ago
Tin

Importing custom Alpine data

I'm trying to define a custom alpine data like this: But I get the error: module.esm.js:423 Uncaught ReferenceError: reservationTimeline is not defined What am I doing wrong? πŸ™‚
4 Replies
Tin
TinOPβ€’2y ago
Tin
TinOPβ€’2y ago
My reservationTimeline.js :
Tin
TinOPβ€’2y ago
Apparently import Alpine from "alpinejs" was the issue. I don't know how does he get the context in that listener but it works now πŸ˜„ This is closed, but if someone wants to explain how does the listener resolve Alpine inside please do πŸ™‚
awcodes
awcodesβ€’2y ago
Alpine provides itself as part of the alpine:init event callback. So your script never runs until alpine calls it.
Want results from more Discord servers?
Add your server