manuel
February 20, 2023, 2:54pm
1
What are you trying to accomplish
How can I plug in jquery-ui using System.import? I am trying these line of codes but I’m having an error/can’t make it work
const jqueryData = await System.import('https://cdn.builder.io/systemjs/jquery-ui.min.js');
const jQuery = jqueryData.default;
Hi @manuel ,
For importing 3rd party library, you may find help at Efficiently exposing bundled libraries to Builder custom JS
If the above doesn’t help then could you please tell us what error are you getting or share a screenshot?
manuel
February 20, 2023, 3:58pm
3
Hi @manish-sharma ,
I’m just getting an error response of 404. Is there a list of available 3rd party libraries or I’m just importing the library in the wrong way?
manuel
February 20, 2023, 4:06pm
5
Here’s how I am importing it:
import 'systemjs/dist/s.min.js'
async function main () {
const jqueryData = await System.import('https://cdn.builder.io/systemjs/jquery-ui.min.js');
const jQuery = jqueryData.default;
Hi @manuel ,
System.import is deprecated now and doesn’t work, we recommend importing jQuery in your project using the tag if you are using builder webcomponents API.
In case you are using any other SDKs then we recommend passing libraries, data, and functions to Builder content through the data
and context
props.
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/6.13.0/system.min.js" integrity="sha512-Yt9xiHZgPuo/cAJKrKCwSG5jQivTcInaav5OfcMwF1wPo06Q7OGog4uwmRPn7R2/a8xOdYB1bmgUkI3ZdI/sdQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>