Import JavaScripts' library in application.js in Rails using Yarn

147 views Asked by At

I am using Yarn to install some libraries into my application on Rails. I recently installed ldcolorpicker but it's like my application can't reach it. I used the appropriate command given by Yarn yarn add @loadingio/ldcolorpicker and imported on my application.js too using //= require @loadingio/ldcolorpicker/index.js. But it's like the import was not successfully done, because my js console gives me:

Uncaught TypeError: ldcolorpicker.init is not a function

What I am doing wrong?

1

There are 1 answers

0
xAspired On

Update: It is like I cannot import in my application.js packages with @. I also added the new amcharts4 with the same issue too. Any advice?