Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Jsonwebtoken don't support verbatimModuleSyntax typescript compiler option

Open
#942 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
nodejs, typescript, vite

Research direction

Start with the Vite reproduction, including mains.ts and tsconfig.json extending @vue/tsconfig/tsconfig.dom.json, and run npm dev with verbatimModuleSyntax enabled. Trace the jsonwebtoken decode import and verify that the runtime error no longer occurs under the listed package versions.

Written by the indexing model from the issue text.

Description

Description

When the verbatimModuleSyntax typescript compiler option is set to true, the import of jsonwebtoken raise an error on runtime Cannot read properties of undefined (reading 'from')

In my tsconfig.json file, I extend the @vue/tsconfig/tsconfig.dom.json file. The verbatimModuleSyntax comes from here.

Reproduction
  • Create a new project with Vite with Vue
  • import jsonwebtoken @types/jsonwebtoken @vue/tsconfig librairies
  • In the mains.ts file, add import { decode } from "jsonwebtoken";
  • In tsconfig.json file, add "extends": "@vue/tsconfig/tsconfig.dom.json"
  • Run npm dev
Environment

package.json

{
  "name": "vite-project",
  "private": true,
  "version": "0.0.0",
  "type": "module",
  "scripts": {
    "dev": "vite",
    "build": "vue-tsc && vite build",
    "preview": "vite preview"
  },
  "dependencies": {
    "@types/jsonwebtoken": "^9.0.3",
    "@vue/tsconfig": "^0.4.0",
    "jsonwebtoken": "^9.0.2",
    "vue": "^3.3.4"
  },
  "devDependencies": {
    "@vitejs/plugin-vue": "^4.2.3",
    "typescript": "^5.0.2",
    "vite": "^4.4.5",
    "vue-tsc": "^1.8.5"
  }
}
Dominant language
JavaScript
Stars
18.2k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from auth0/node-jsonwebtoken

All issues in auth0/node-jsonwebtoken

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.