exceljs
exceljs copied to clipboard
Cannot use streaming with angular8,
When I use angular8 , I have test "import * as Excel from 'exceljs/dist/exceljs.min.js';" and get response sviz.error.handler.ts:68 TypeError: Cannot read property 'xlsx' of undefined; I tried to use "import Excel from 'exceljs/modern.browser';" with errors : ERROR in ./node_modules/exceljs/dist/es5/csv/csv.js Module not found: Error: Can't resolve 'fs' in 'C:\Users\P092785\SVIZ\sviz-stack\app\sviz\node_modules\exceljs\dist\es5\csv' ... failed to compile
Anybody can help me?
fs
is a filesystem module which is available for the node version. What happens if you don't target a specific file? Like this:
import Excel from 'exceljs';
fs
is a filesystem module which is available for the node version. What happens if you don't target a specific file? Like this:import Excel from 'exceljs';
Thank you for the response,after i remove the specific file, the application runs, but when i try to use the function Excel.stream.xlsx.WorkbookWriter, there are some errors: TypeError: Cannot read property 'xlsx' of undefined
fs
is a filesystem module which is available for the node version. What happens if you don't target a specific file? Like this:import Excel from 'exceljs';
Thank again, maybe i found where the problem comes, exceljs does not support the streaming workbook writer within a brower environement....
Browser
A portion of this library has been isolated and tested for use within a browser environment.
Due to the streaming nature of the workbook reader and workbook writer, these have not been included. Only the document based workbook may be used (see Create a Workbook for details).
For example code using ExcelJS in the browser take a look at the spec/browser folder in the github repo.
😂I'm confused, too. But now I've found this description