Skip to content

Vite auto-reload (HMR?) #913

@jwoertink

Description

@jwoertink

With #912 the memory leak will be gone, but I noticed some weird issues when updating the javascript file.

In development, the main script loads

Image Image

if I update the src/js/app.js file, it seems like this vite asset server will update, but my app doesn't.

For example, if I just remove all of the Rails stuff, and add console.log("HI"), then I refresh my app page, I won't see the console log. Then I go to http://localhost:3001/src/js/app.js and I'll my code change, but no amount of refreshing will actually run my new code changes. I have to stop the whole lucky server, then restart it to get my changes.

Along with that, if we don't add the type: "module" to the script tag, then it fails because of the import. I was under the impression that it would all be bundled up like what mix did, but maybe that's wrong? We didn't need type: "module" with mix, so I'm not sure if that's something we will just need for Vite, or is that something that only exists for development?

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedAdditional expertise neededjavascriptPull requests that update Javascript code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions