Installing SearchBuilder via importmap

Installing SearchBuilder via importmap

tacman1123tacman1123 Posts: 198Questions: 46Answers: 1

Something seems different about searchbuilder. It's on 1.6, when everything else is on 2.2.

Also, the link to importmap on this page is broken.

https://cdn.datatables.net/searchbuilder/1.6.0/

I'm trying to put a test case together, but since I'm using Symfony's AssetMapper it's hard to recreate on jsdelivr. But I'm installing searchbuilder the same way I install searchpanes. But the import for searchbuilder fails:

import 'datatables.net-select-bs5';
import 'datatables.net-searchpanes-bs5';
import 'datatables.net-searchbuilder-bs5; // <--- 

FWIW, I'm using jsdelivr, not the datatables cdn.

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 63,445Questions: 1Answers: 10,465 Site admin

    Can you show me the import map you are using please? Also, what is the error message?

    Allan

  • tacman1123tacman1123 Posts: 198Questions: 46Answers: 1
    edited January 12

    I'm having trouble posting. Here's the head of the 2 js files:

    head datatables.net-searchbuilder*/* -n 9
    ==> datatables.net-searchbuilder-bs5/datatables.net-searchbuilder-bs5.index-c8dcff01f171d1b073e0882f866e0844.js <==
    /**
     * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
     * Original file: /npm/datatables.net-searchbuilder-bs5@1.6.0/js/searchBuilder.bootstrap5.mjs
     *
     * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
     */
    import t from"jquery";import e from"datatables.net-bs5";export{default}from"datatables.net-bs5";import"datatables.net-searchbuilder";
    /*! Bootstrap 5 ui integration for DataTables' SearchBuilder
     * © SpryMedia Ltd - datatables.net/license
    
    ==> datatables.net-searchbuilder/datatables.net-searchbuilder.index-38a954f5a6d2cf1e3c74a3257997f182.js <==
    /**
     * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
     * Original file: /npm/datatables.net-searchbuilder@1.6.0/js/dataTables.searchBuilder.mjs
     *
     * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
     */
    import t from"jquery";import i from"datatables.net";export{default}from"datatables.net";
    /*! SearchBuilder 1.6.0
     * ©SpryMedia Ltd - datatables.net/license/mit
    
  • tacman1123tacman1123 Posts: 198Questions: 46Answers: 1

    The importmap:

      "datatables.net-searchbuilder-bs5": "/assets/vendor/datatables.net-searchbuilder-bs5/datatables.net-searchbuilder-bs5.index-c8dcff01f171d1b073e0882f866e0844.js",
            "datatables.net-searchbuilder": "/assets/vendor/datatables.net-searchbuilder/datatables.net-searchbuilder.index-38a954f5a6d2cf1e3c74a3257997f182.js",```
    

    The message with that.

  • allanallan Posts: 63,445Questions: 1Answers: 10,465 Site admin
    Answer ✓

    You are missing a ' at the end of the import statement. It should be:

    import 'datatables.net-searchbuilder-bs5';
    

    Allan

  • tacman1123tacman1123 Posts: 198Questions: 46Answers: 1

    DOH! I was on my small-screened laptop without a second monitor, and I guess I just can't see. :-(

    Thanks.

  • allanallan Posts: 63,445Questions: 1Answers: 10,465 Site admin
    Answer ✓

    No worries :)

    Allan

Sign In or Register to comment.