import `jsonwebtoken` throws error
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 32/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript, node.js
調査の方向性
まず、Node.js 21.7.0でnode-jsonwebtoken 9.0.2を使って名前付きインポートを再現し、その後、パッケージのエントリーポイントと動作を9.0.0と比較します。文書化されている名前付きインポートが再び機能し、既存のCommonJSの使用を壊すことなく、報告されたエラーが発生しなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Description
import jsonwebtoken throws error
Reproduction
The code:
import { verify } from "jsonwebtoken";
The error message:
import { verify } from "jsonwebtoken";
^^^^^^
SyntaxError: Named export 'verify' not found. The requested module 'jsonwebtoken' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'jsonwebtoken';
const { verify } = pkg;
at ModuleJob._instantiate (node:internal/modules/esm/module_job:134:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:217:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:323:24)
at async loadESM (node:internal/process/esm_loader:28:7)
at async handleMainPromise (node:internal/modules/run_main:120:12)
Node.js v21.7.0
It works on v9.0.0 but fails on 9.0.2.
Environment
Please provide the following:
- Version of this library used: 9.0.2
- Version of the platform or framework used, if applicable:
- Other relevant versions (language, server software, OS, browser):
- Other modules/plugins/libraries that might be involved:
- 主要言語
- JavaScript
- スター
- 18.2k
- フォーク
- 1.3k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
auth0/node-jsonwebtoken のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
auth0/node-jsonwebtoken#1042 · コメント 1 件 ·
-
`jwt.sign()` callback is executed twice for "The payload already has an "..." property" errors対応中かも @cobyfrombrooklyn-bot が 222 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
auth0/node-jsonwebtoken#1000 · コメント 2 件 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
auth0/node-jsonwebtoken#1048 ·
-
verify() resolves a string secret by attempting createPublicKey() first, costing 4x-52x on the HS* path対応中かも @Hashim1999164 が 16 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 65/100
auth0/node-jsonwebtoken#1046 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
auth0/node-jsonwebtoken#1034 ·
auth0/node-jsonwebtoken の issue をすべて見る
似ている issue
-
good first issue quality
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
StudentSuite/awesome-student-resources#554 ·
メンテナーはふだん 1 日以内に返信
-
content good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
StudentSuite/awesome-skills-plugins-for-students#297 ·
メンテナーはふだん 1 日以内に返信
-
Link Checker Reportオープンautomated issue report
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100