Coder Social home page Coder Social logo

Comments (5)

1cg avatar 1cg commented on July 4, 2024

may be related to #2629

not familiar w/ webpack does it use any of the javascript modules? if so you might need to switch to the new module-specific files in the distribution

from htmx.

Jesmaster avatar Jesmaster commented on July 4, 2024

The webpack installation documentation hasn't been updated so I assumed the setup is the same. None of the other js libraries I use in webpack need to specifiy any special module types.

https://htmx.org/docs/#webpack

from htmx.

1cg avatar 1cg commented on July 4, 2024

entirely possible that those instructions are wrong now, unfortunately, since no one on the core team that I'm aware of uses webpack. We will get the .d.ts file fixed in the next release and then we can try again, and then maybe try by referencing one of the module files (/dist/htmx.esm.js ?) and then update the docs if necessary. Can you try referencing the esm file now just to see if it does anything different?

from htmx.

Jesmaster avatar Jesmaster commented on July 4, 2024

I figured out how to set it up correctly. I'll create a pull request to fix the documentation.

For anyone who needs it

window.htmx = require('htmx.org');

becomes

import htmx from "htmx.org/dist/htmx.esm";
window.htmx = htmx;

from htmx.

restless avatar restless commented on July 4, 2024

Thanks @Jesmaster you've helped me to resolve my issue.

I use Vite and I had to do a similar change there. In the vite.config.js file i had to replace htmx.org with the htmx.org/dist/htmx.esm:

    plugins: [
      inject({
        htmx: 'htmx.org/dist/htmx.esm',
      }),
    ],

This is related to: #1690

from htmx.

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.