7 months ago

Laravel-JS: Weird $().XYZ is not a function problem

Posted 7 months ago by oliiix

So this is very strange and I know that the order of the included scripts matters

bootstrap > jquery > jquery-ui > colorpicker > colorpicker_include/start.

I try to get colorpicker and summernote working. Tried by directly inserting the whole folders into a public/vendor folder and reference with html tags directly into those folders, then i got to know mix and webpack and added the files to a _custom.js that is imported in app.js so the public folder gets populated by npm run dev. The files are all included as I can tell from checking the pages source code and searching for bootstrap jquery jquery-ui and colorpicker (or summernote) and it's all just there in proper order but i always get the errors $().colorpicker is not a function in the frontend... It is as if the separate included js files can't see/talk to each other (only some). Very strange. On the other hand at least i did get the datepicker to work just fine...

i've installed both with npm/composer... not sure what the diff is exactly. i know composer also edits the package.json for you, and what npm does, huhhh :D but still i mean the files are there so why can't they talk to each other^^

Thanks for any advice you might have :)

Please sign in or create an account to participate in this conversation.