Skip to content

[BUG]: TypeError: Cannot read properties of undefined (reading '3') #234

@Qlub53

Description

@Qlub53

Version

6.0.1

Description

I understand that this error used to be brought up multiple times, but even the official example does not run.
https://www.npmjs.com/package/typescript-json-serializer#usage

Both serialization and deserialization fails with the same error.

Error

TypeError: Cannot read properties of undefined (reading '3')
    at $PROJECT_HOME/node_modules/typescript-json-serializer/dist/index.cjs.js:1:13378
    at file://$PROJECT_HOME/test/typescript-json-serializer.test.ts:1:543
    at __decorateClass (file://$PROJECT_HOME/test/typescript-json-serializer.test.ts:1:403)
    at <anonymous> ($PROJECT_HOME/test/typescript-json-serializer.test.ts:24:8)
    at ModuleJob.run (node:internal/modules/esm/module_job:274:25)
    at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:644:26)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:116:5)

Reproduction

  1. typescript-json-serializer.test.ts
  2. package.json
  3. tsconfig.json
  4. Run
node --import=tsx typescript-json-serializer.test.ts
# OR
npx tsx typescript-json-serializer.test.ts

On which OS the bug appears?

macOS 15

What is your project type?

Node.js v22.15.0
Node.js v18.18.2

On which build mode the bug appears?

both

Anything else?

Please help! 🙏

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions