Skip to content

XLSX export does not work #339

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

Closed
arsrobota opened this issue Dec 16, 2021 · 5 comments
Closed

XLSX export does not work #339

arsrobota opened this issue Dec 16, 2021 · 5 comments

Comments

@arsrobota
Copy link

Hello,
If I import tableexport.jquery.plugin/libs/js-xlsx/xlsx.core.min then XLSX export fails with message Uncaught ReferenceError: XLSX is not defined. If I try importing xlsx/dist/xlsx.full.min instead, it fails again with message Uncaught ReferenceError: XLSX.utils is not defined. On the other hand Excel export works well.
Do I miss something ?
I use Bootstrap-Table 1.19.1 with tableexport.jquery.plugin 1.20.1 under Webpack 5.59.1.

Many thanks !

@hhurz
Copy link
Owner

hhurz commented Dec 16, 2021

Unfortunately, I can't really answer this question as I'm not a bootstrap expert. The "ReferenceError: XLSX is not defined" message indicates that the xlsx.core.min file could not be loaded. Is the directory path correct? Does the file exist? There is a xlsx test file (without bootstrap) that could help you to track down your issue.

@arsrobota
Copy link
Author

Hi hhurz, thanks for your reply.
The path to xlsx.core.min.js correct. I can export an XLSX file with your test page.
Perhaps the problem is on webpack side...

@arsrobota
Copy link
Author

Inspecting webpack console, I can see when I import tableexport.jquery.plugin/libs/js-xlsx/xlsx.core.min I get an Error: Can't resolve 'fs' in 'D:\symfony\gar\node_modules\tableexport.jquery.plugin\libs\js-xlsx'" -t "Webpack Encore"

@hhurz
Copy link
Owner

hhurz commented Dec 17, 2021

A little bit googling leeds to this webpack isssue. Perhaps it helps.

@arsrobota
Copy link
Author

Thanks for the link. I also found this Webpack migration guide as an update. Unfortunately it looks like Webpack Encore does not support resolve.fallback.

@hhurz hhurz closed this as completed Mar 9, 2022
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