Closed vallafederico closed 1 year ago
This is the expected behaviour, but just not a useful error message.
So your pages have home
and about
declared as the renderers you want to use, they have just not been registered with Taxi yet.
const taxi = new Core({
renderers: {
default: Renderer,
home: HomeRenderer,
about: AboutRenderer,
}
});
While Taxi could fall back to the default renderer in these situations, I would say that would cause bugs which would be harder to debug: If you had created a HomeRenderer
and an AboutRenderer
and forgotten to register them, the page would still load but none of your specific renderer code would be executed, leading you down a long path to try and work out why.
I have added a console.warn and updated the npm package š
https://github.com/craftedbygc/taxi/blob/7e793185ac1206cc69895835528907a552c42ac8/src/Core.js#L456
So now if you run into this issue, at least working out the cause will be considerably easier!
I guess it makes sense!
Thanks @jakewhiteley amazing you're doing here.
Describe the bug
createCacheEntry()
fails if page hasdata-taxi-view
attribute specificed and no custom Renderer.Not totally sure this is a bug or intended behaviour tbh, I felt as if it was a bug as it was unexpected and took me a minute to actually figure out.
To Reproduce Minimal StackBlitz Example. You can switch from
main.js
tofixed.js
in home page script to simulate what the behaviour I'd consider normal should be. Two pages,data-taxi-view="home"
&data-taxi-view="about"
.main.js
renderers
andtransition
can even be avoided but put them there just to make sure that wouldn't somehow fix it.Info Error in the console
Looking into it Renderer is actually undefined.
Maybe Fix?
Am I missing something? Is it the actual expected behaviour? Still, thanks for the amazing work in any case and sorry to bother ā¤ļø