F
Filament4mo ago
Chris

Javascript Module Import

Hello, I am trying to import a Javascript file from either public or resources - whichever is easier. It appers it needs to be imported as a module, but I am seeing this error
Uncaught TypeError: Failed to resolve module specifier "filepond". Relative references must start with either "/", "./", or "../".
Uncaught TypeError: Failed to resolve module specifier "filepond". Relative references must start with either "/", "./", or "../".
I have attaches some code below. Thank you for any help you may have. In AppServiceProvider boot method
FilamentAsset::register([
Js::make('file-pond',url('/js/app/file-pond.js'))->module(),
]);
FilamentAsset::register([
Js::make('file-pond',url('/js/app/file-pond.js'))->module(),
]);
And then trying to use as follows
//
import * as FilePond from 'filepond';


window.FilePond = FilePond;
//
import * as FilePond from 'filepond';


window.FilePond = FilePond;
If there is a better way to access the filepond instance from blade I am also open to that.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server