F
Filament14mo ago
Arko

Importing a js lib via Async Alpine

I'm loading an Alpine component asynchronously, however now my lib import doesn't work anymore:
import Tribute from "tributejs";
import Tribute from "tributejs";
Gives me this error:
Uncaught (in promise) TypeError: Failed to resolve module specifier "tributejs". Relative references must start with either "/", "./", or "../".
Uncaught (in promise) TypeError: Failed to resolve module specifier "tributejs". Relative references must start with either "/", "./", or "../".
Now tossing in the full relative path import Tribute from "../../../../node_modules/tributejs/dist/tribute.esm.js"; also doesn't work since its loaded via http, so it'd try to load this: https://my-app.test/node_modules/tributejs/dist/tribute.esm.js which obviously wouldnt work. Do I need to somehow compile this tributejs into public for this to work with async alpine?
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server