Skip to content

TypeError with Node Typescript #15

@samuelallan72

Description

@samuelallan72

When using this library with Node's direct Typescript running support, or with Deno, I get this TypeError:

$ node ./src/app.ts
...
file:///...project/node_modules/.pnpm/@[email protected]/node_modules/@chronicstone/typed-xlsx/dist/index.mjs:433
    const workbook = XLSXUtils.utils.book_new();
                                     ^

TypeError: Cannot read properties of undefined (reading 'book_new')
    at ExcelBuilder.build (file:///...project/node_modules/.pnpm/@[email protected]/node_modules/@chronicstone/typed-xlsx/dist/index.mjs:433:38)
    at Object.build (file:///...project/node_modules/.pnpm/@[email protected]/node_modules/@chronicstone/typed-xlsx/dist/index.mjs:428:31)
    at main (file:///...project/src/app.ts:80:6)
    at process.processTicksAndRejections (node:internal/process/task_queues:103:5)

Node.js v24.11.1

This is '@chronicstone/typed-xlsx' version 0.2.17.

It may be an issue with https://github.com/gitbrent/xlsx-js-style/

I don't see this when building with tsc first with the following tsconfig.json:

{
  "compilerOptions": {
    "module": "nodenext",
    "outDir": "dist",
    "strict": true
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions