Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3925

webpack encore and jquery ui (dateRangeSlider)

$
0
0

I'm having trouble integrating a jquery-ui plugin with my Symfony app using Webpack Encore. You can see the error (TypeError: t(...).dateRangeSlider is not a function[Learn More]) in the console:

https://date-range-demo.herokuapp.com/en/blog/search

enter image description here

Source code for this is at https://github.com/tacman/range-slider-demo, it's simply the symfony demo with a date range slider on the search page, via the following changes:

add the libraries to package.json from the command line

yarn add jquery-ui jqrangeslider

add to /blog/search.html

<div id="slider">Slider Placeholder</div>

added to assets/js/search.js

import 'jquery-ui'; 
import 'jqrangeslider';

$('#slider').dateRangeSlider();

Assets are build with 'yarn run encore dev', I'm sure it's a simple configuration error but I can't figure out what it is.

Deployment to heroku added a few more things, but are unrelated to the plugin not loading. To see this error locally, simply clone the repo, run composer install && yarn install && yarn run encore dev, then start the server and go to /en/blog/search.

Thanks for any help on this!


Viewing all articles
Browse latest Browse all 3925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>