Blank tables after getting version 4.6

Blank tables after getting version 4.6

CalLabSolutionsCalLabSolutions Posts: 8Questions: 1Answers: 0
edited November 2023 in Free community support

Happens on App start up, so I don't have a 'test case'

Debugger code (debug.datatables.net):

(function( factory ){
    if ( typeof define === 'function' && define.amd ) {
        // AMD
        define( ['jquery', 'datatables.net'], function ( $ ) {
            return factory( $, window, document );
        } );
    }
    else if ( typeof exports === 'object' ) {
        // CommonJS
        var jq = require('jquery');
        var cjsRequires = function (root, $) {
            if ( ! $.fn.dataTable ) {
                require('datatables.net')(root, $);
            }

Error messages shown:

dataTables.bootstrap4.js:17 Uncaught TypeError: require(...) is not a function
    at cjsRequires (dataTables.bootstrap4.js:17:1)
    at dataTables.bootstrap4.js:38:1
    at 37.datatables.net (dataTables.bootstrap4.js:46:1)
    at o (_prelude.js:1:1)
    at _prelude.js:1:1
    at 1072../agent (common.js:16:1)
    at o (_prelude.js:1:1)
    at _prelude.js:1:1
    at 1070../common.js (agent.js:1:1)
    at o (_prelude.js:1:1)

Description of problem: This error did not occur until I updated npm. The failure is indicating the line in the code "require('datatables.net')(root, $);". I looked at this link, https://datatables.net/blog/2022-11-10-esm#Backwards-compatibility from a previous issue of the same type. I am not sure it's the same issue. We do bundle the files but they aren't being changed to ES
This error is not occurring in our code, it's in the bootstrap.net-bs4 file, so I'm not sure how to fix this. I'm assuming 'require' is not actually the issue as the previous require('jquery') does not fail. I have both .js and .mjs files in my node library. Unfortunately, our deployments do a node update so we cannot do a deployment until we can fix this.

Any suggestions to fix this would be greatly appreciated.

Replies

  • allanallan Posts: 62,990Questions: 1Answers: 10,367 Site admin

    What version of the datables.net and datables.net-bs4 packages are you using? There was an error with some of the earlier 1.13 releases if I recall correctly. I can't recall off the top of my head what version it was fixed in, but if you aren't using 1.13.7, it would be worth updating those two packages.

    Allan

  • CalLabSolutionsCalLabSolutions Posts: 8Questions: 1Answers: 0

    NPM pulled in versions 1.13.7. We let it do an auto-update in our test and production deployment. But not in our development environments.

  • allanallan Posts: 62,990Questions: 1Answers: 10,367 Site admin

    Okay - to confirm, you are still getting the error with 1.13.7?

    Is the error during a build step, or on the page when loaded in a browser? If the latter, can you give me a link to it? If the former, can you show me how you are doing the build?

    Allan

  • CalLabSolutionsCalLabSolutions Posts: 8Questions: 1Answers: 0

    Our previous version was 1.13.4 and we had no issues with that version.

  • allanallan Posts: 62,990Questions: 1Answers: 10,367 Site admin

    Okay - thank you. I'll assume from that, that it is 1.13.7 you are using.

    Is the error during a build step, or on the page when loaded in a browser? If the latter, can you give me a link to it? If the former, can you show me how you are doing the build?

    Could you possibly answer these points please? I'd really like to get to the bottom of what is going on and why it isn't working for you, but I'm afraid I'll need more information, as I don't recall having seen this specific issue before in the latest releases.

    Allan

  • CalLabSolutionsCalLabSolutions Posts: 8Questions: 1Answers: 0

    It occurs when the browser loads. I will need a way to allow you to sign in. Can you send me an email at dwolfe@callabsolutions.com. I will enable you access to a test environment.

  • allanallan Posts: 62,990Questions: 1Answers: 10,367 Site admin

    That would be great - tha is. Email sent.

    Allan

Sign In or Register to comment.