Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade 3.0.2 to 3.0.3 creates TypeError #131

Open
uhafner opened this issue Sep 9, 2024 · 6 comments
Open

Upgrade 3.0.2 to 3.0.3 creates TypeError #131

uhafner opened this issue Sep 9, 2024 · 6 comments

Comments

@uhafner
Copy link

uhafner commented Sep 9, 2024

I packaged DataTables with the responsive module as a Jenkins DataTables Plugin so that Jenkins plugins can use DataTables in their views. The plugin deploys the following artifacts as a Jenkins plugin:

 "dependencies": {
    "datatables.net": "2.1.6",
    "datatables.net-bs5": "2.1.6",
    "datatables.net-buttons": "3.1.2",
    "datatables.net-buttons-bs5": "3.1.2",
    "datatables.net-colreorder": "2.0.4",
    "datatables.net-colreorder-bs5": "2.0.4",
    "datatables.net-responsive": "3.0.3",
    "datatables.net-responsive-bs5": "3.0.3",
    "datatables.net-select": "2.0.5",
    "datatables.net-select-bs5": "2.0.5",
    "datatables.mark.js": "2.1.0",
    "mark.js": "8.11.1",
    "luxon": "3.5.0"
  }

When I upgrade the dependency to datatables.net-responsive from 3.0.2 to 3.0.3 I get the following error:

jquery.min.js:2 jQuery.Deferred exception: Cannot read properties of undefined (reading '_responsiveMovesNodes') TypeError: Cannot read properties of undefined (reading '_responsiveMovesNodes')
    at a._resizeAuto (http://localhost:8080/static/4ac28f67/plugin/data-tables-api/js/dataTables.responsive.min.js:4:9609)
    at HTMLTableElement.<anonymous> (http://localhost:8080/static/4ac28f67/plugin/data-tables-api/js/dataTables.responsive.min.js:4:2584)
    at HTMLTableElement.<anonymous> (http://localhost:8080/static/4ac28f67/plugin/data-tables-api/js/dataTables.min.js:4:72080)
    at HTMLTableElement.dispatch (http://localhost:8080/static/4ac28f67/plugin/jquery3-api/js/jquery.min.js:2:40035)
    at v.handle (http://localhost:8080/static/4ac28f67/plugin/jquery3-api/js/jquery.min.js:2:38006)
    at Object.trigger (http://localhost:8080/static/4ac28f67/plugin/jquery3-api/js/jquery.min.js:2:70124)
    at HTMLTableElement.<anonymous> (http://localhost:8080/static/4ac28f67/plugin/jquery3-api/js/jquery.min.js:2:70726)
    at Function.each (http://localhost:8080/static/4ac28f67/plugin/jquery3-api/js/jquery.min.js:2:3129)
    at ce.fn.init.each (http://localhost:8080/static/4ac28f67/plugin/jquery3-api/js/jquery.min.js:2:1594)
    at ce.fn.init.trigger (http://localhost:8080/static/4ac28f67/plugin/jquery3-api/js/jquery.min.js:2:70701) undefined

An example of a Jenkins view with DataTables (with datatables.net-responsive 3.0.2) is visible in
https://ci.jenkins.io/job/Plugins/job/coverage-model/job/main/lastSuccessfulBuild/coverage/

When I downgrade to 3.0.2 then everything works again, so there seems to be an incompatible change in 3.0.3.

Please let me know when you need more details.

@AllanJard
Copy link
Contributor

Can you create a simple test case showing the issue please so I can debug and resolve it please? I don't immediately see that error in the examples here, so there must be some configuration or setup that I'm missing.

@uhafner
Copy link
Author

uhafner commented Sep 9, 2024

Do you mean a standalone test case? Or something with the whole Jenkins setup that shows the problem in a running Jenkins instance?

@AllanJard
Copy link
Contributor

A standalone test case that I can debug please. At the moment I'm not sure how I can see the issue.

@uhafner
Copy link
Author

uhafner commented Sep 10, 2024

Ok, I will give my best to create a standalone example.

One additional note, maybe this is relevant: the table is filled by an Ajax call. So the error occurs when the tables still is empty.

@uhafner
Copy link
Author

uhafner commented Sep 10, 2024

And an unrelated note on the example you linked above: there are two includes:

Is this correct?

@AllanJard
Copy link
Contributor

Yes. The dataTables.responsive.js one is the main file. The responsive.dataTables.js one is more or less redundant for DataTables default styling, but if you switch to Bootstrap you would see it would change to responsive.bootstrap5.js.

The "rules" for file names are codified here.

The download builder is the best way to make sure you get the code you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants