[BUG] Works locally, but not on server - TypeError: g.Workbook is not a constructor
- Dominant language
- JavaScript
- Stars
- 15.5k
- Forks
- 2k
- PR merge metrics
- No merged PRs in 30d
Description
## 🐛 Bug Report
I have this working on my local machine, but it does not work on the dev server.
The excel file does not download, and I get this error:
`Uncaught TypeError: g.Workbook is not a constructor`
I have tried the solutions offered on ticket #960 with no success.
Lib version: 4.4.0
## Steps To Reproduce
I am using React + Typescript.
This is the import:
`export * as ExcelJS from 'exceljs';`
This is how I create the workbook:
```
const handleClick = () => {
const workbook = new ExcelJS.Workbook(); //Error occurs here
const sheet = workbook.addWorksheet(`Sheet 1`);
. . .
}
```
## The expected behaviour:
An `xlsx` file should download with a worksheet title "Sheet 1"
## Possible solution (optional, but very helpful):
```javascript
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.