Code Monkey home page Code Monkey logo

Comments (4)

llamux avatar llamux commented on June 29, 2024 1

Thank you for this! It works great for me and looks like a clean solution without adding too much complexity.

And thank you for the rest of your work here. Templ has been a complete pleasure to use. 👍

from templ.

a-h avatar a-h commented on June 29, 2024

Any reason you closed this one?

If it is a problem, it would be pretty easy to rename the variable to templ_src or something, it would just be an update to https://github.com/a-h/templ/blob/main/cmd/templ/generatecmd/proxy/script.js

from templ.

llamux avatar llamux commented on June 29, 2024

Sorry, I didn't want to waste anyone's time and it's not too much trouble to suppress the error messages.

The issue isn't the chosen variable name, but the script re-executing after htmx page changes, causing a re-declaration error. The issue is specific to servers using htmx or htmx-like libraries (like turbo/turbolinks/pjax). I'm not sure if setups like this are common enough among templ users to warrant fixing the error. Unless there is some dead-simple fix that is low-overhead and doesn't break any other use cases, it's probably not worth it.

from templ.

a-h avatar a-h commented on June 29, 2024

I think this could be a wider issue. I ran into myself while testing something. I've put together a little PR, what do you think?

from templ.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.