Apr 14, 2017
0
Level 3
Flatpickr does not register with mix on page
Hello,
I am using the following line in my mix configuration to get flatpickr:
mix.js('node_modules/flatpickr/dist/flatpickr.js', 'public/js/vendor/flatpickr.js')
The file is created in the correct folder, so there are no issue there.
However, when I import it on a page Flatpickr does not get registered in the window. The import is done as below:
<script src="{{ mix('/js/vendor/flatpickr.js') }}"></script>
And I can see that the file is referenced correctly on the loaded webpage, so it's not that the file isn't found.
If I use the flatpickr unpkg url:
<script src="https://unpkg.com/flatpickr"></script>
Then the Flatpickr function does register correctly. Why should there be a difference? It would be great if someone can shed some light.
Thanks!
Saurabh
Please or to participate in this conversation.