Skip to content

Comments

fix: enqueue script with correct name (take into account full name)#8

Open
weber-s wants to merge 1 commit intotailpress:mainfrom
weber-s:main
Open

fix: enqueue script with correct name (take into account full name)#8
weber-s wants to merge 1 commit intotailpress:mainfrom
weber-s:main

Conversation

@weber-s
Copy link

@weber-s weber-s commented Feb 19, 2026

When running vite with devserver, the JS is not loaded as module and so we get "import declarations may only appear at top level of a module" and so on.

This PR fix the filter to load the script tag to match the correct filename (add the asset flename to the base handle).

To reproduce the bug simply add an import in the ressource/js/app.js like:

import Alpine from "alpinejs";

window.addEventListener("load", (event) => {
  window.Alpine = Alpine;
  Alpine.start();
});

and run npm run dev, to get the error. This PR fix it.

Thank for tailpress!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant