2.0 error with importmaps
2.0 error with importmaps
I updated by libraries, and am getting something peculiar that makes me think I have the wrong libraries.
The error is SyntaxError: The requested module 'datatables.net' does not provide an export named 'default' (at datatables.net-bs5.index-3e472a948fa3a14c2fd9c23a81e9ecf5.js:7:30)
on this line: "export {default} from "datatables.net";"
**
* Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
* Original file: /npm/datatables.net-bs5@1.13.11/js/dataTables.bootstrap5.mjs
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
import a from "jquery";
import e from "datatables.net";
export {default} from "datatables.net";
/*! DataTables Bootstrap 5 integration
* 2020 SpryMedia Ltd - datatables.net/license
*/
/ff.wip/favicon.ico 404 (Not Found)
5datatables.net-bs5.index-3e472a948fa3a14c2fd9c23a81e9ecf5.js:7 Uncaught (in promise) SyntaxError: The requested module 'datatables.net' does not provide an export named 'default' (at datatables.net-bs5.index-3e472a948fa3a14c2fd9c23a81e9ecf5.js:7:30)
This is happening locally, I'll try to publish it somewhere if that helps. It does look like all the jsdelivr libraries were updated.
This question has an accepted answers - jump to answer
Answers
I'd need a way to reproduce this really, but
dataTables.mjs
definitely does export a default - you can see it on the last line here. I wonderif you might be using the UMD files (.js
) rather than the ESM ones (.mjs
).Allan
something's amiss with the importmap libraries on jsdelivr.
Hmm, gut feeling is that it's related to your library updated.
Nonetheless, I've opened an issue in the assetmapper component:
https://github.com/symfony/symfony/issues/54096
It's really easy to install and see the error, at least the installation error, please participate there if it makes sense.
It's not the update to the asset-mapper component, though. Because the update fails even in the current version, which has been working for months, and without any changes except updating to the datatables libraries, the issue happens.
This part at least is wrong (it resolves to a 404 later in the message that you quote.
The correct file is now named
datatables.net-dt/css/dataTables.dataTables.min.css
. Same file, different name.Is that file defined in your package somewhere? I'm not clear on where that would be defined?
Allan
Hmmm that file is referenced for DataTables 1.13.8. It still exists there. But not in 2.x. I'm not clear on why the version referenced is 1.x, but it is pulling in 2.x?
Allan
yes, removing that helped. Not sure how the Symfony tool should handle moved / missing files.
Removing the files that were renamed seems have solved the problem. Thanks!
Awesome. Thanks for letting me know.
Allan