Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82760

Error with jquery from datatables.mjs when running npm run build

$
0
0

Hi!

I'm new using datatables, but I hve to say it's amazing and I am already in love with it.

I am using it with vue3+vite, and it works fine witn the "npm run dev" command, but when I try to build it with "npm run build" I get the following error, where datatables.mjs imports jquery.

x Build failed in 7.28s
error during build:
node_modules/datatables.net/js/dataTables.mjs (5:7): "default" is not exported by "node_modules/jquery/dist/jquery.js", imported by "node_modules/datatables.net/js/dataTables.mjs".
file: /home/alf/OpenMagnetics/WebFrontend/node_modules/datatables.net/js/dataTables.mjs:5:7

3:  */
4:
5: import jQuery from 'jquery';
          ^
6:
7: // DataTables code uses $ internally, but we want to be able to

    at getRollupError (file:///home/alf/OpenMagnetics/WebFrontend/node_modules/rollup/dist/es/shared/parseAst.js:396:41)
    at error (file:///home/alf/OpenMagnetics/WebFrontend/node_modules/rollup/dist/es/shared/parseAst.js:392:42)
    at Module.error (file:///home/alf/OpenMagnetics/WebFrontend/node_modules/rollup/dist/es/shared/node-entry.js:15715:16)
    at Module.traceVariable (file:///home/alf/OpenMagnetics/WebFrontend/node_modules/rollup/dist/es/shared/node-entry.js:16164:29)
    at ModuleScope.findVariable (file:///home/alf/OpenMagnetics/WebFrontend/node_modules/rollup/dist/es/shared/node-entry.js:13886:39)
    at Identifier.bind (file:///home/alf/OpenMagnetics/WebFrontend/node_modules/rollup/dist/es/shared/node-entry.js:5088:40)
    at VariableDeclarator.bind (file:///home/alf/OpenMagnetics/WebFrontend/node_modules/rollup/dist/es/shared/node-entry.js:2675:23)
    at VariableDeclaration.bind (file:///home/alf/OpenMagnetics/WebFrontend/node_modules/rollup/dist/es/shared/node-entry.js:2671:28)
    at Program.bind (file:///home/alf/OpenMagnetics/WebFrontend/node_modules/rollup/dist/es/shared/node-entry.js:2671:28)
    at Module.bindReferences (file:///home/alf/OpenMagnetics/WebFrontend/node_modules/rollup/dist/es/shared/node-entry.js:15694:18)

Do you guys know how I can fix it and use datatables in production?

Thanks a lot!


Viewing all articles
Browse latest Browse all 82760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>