-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scripts are not executed in the page loaded by taxi.js #18
Comments
I made it work by manually searching for |
Hi @MehrdadKhnzd , Your solution describes pretty much exactly what taxi.js already does. Did you read the section on reloading js? It sounds like you just need to tweak the |
Astro is a bit more tricky as all js for a page seems to be called I'll continue looking into it as I am also working with astro at the moment, but pelase share if you find a working solution. |
I do not know if it is related to the issue @MehrdadKhnzd was experiencing, but the same was happening to me (not using any JavaScript framework). I was having a hard time finding out what it was, since Taxi.js was actually injecting/replacing the script tags accordingly, but the scripts were being executed only once and on the first visit to the page. The reason for this was that my scripts had the attribute I do not know if there is any way to work around this, but maybe it would be worth adding this information to the documentation? |
@andrepimpao hmm sounds like something to investigate! Can anyone provide a basic repo/codepen with an example? |
@jakewhiteley sure. Repo here: https://github.com/andrepimpao/taxi-script-module. I tried adding a cache buster to the Let me know if I can help in any way. |
@andrepimpao what about adding I think you are right in that other than cachebusting, there is no native way to solve this. |
@jakewhiteley I think you are referring to Astro, but I'm not using it (@MehrdadKhnzd was though). I can use a different approach with how I manage the scripts in my projects and make it work with taxi.js, that's not a problem. I just think it would be worth adding some information regarding this in the docs as it may help another developer (I spent almost a day trying to figure it out what was going on). Thank you for your time. |
Describe the bug
So, I'm trying to use this library to add some SPA-like functionality to my
Astro
+SolidJS
website.I made it work, but the problem is that my islands don't work when I navigate using
taxi.js
, and everything becomes static.It seems that the
script
tags are not executed whentaxi.js
fetches a new page.Whenever I first directly visit a page that contains the islands,
taxi.js
works if I go to other pages and get back.But if I first visit a static page and then navigate to the page with the islands, it doesn't work and becomes static.
To Reproduce
An
Astro
project with any external component (e.g.SolidJS
in my case).The text was updated successfully, but these errors were encountered: