`TypeError` due to `URL(window.location.href)` after upgrading to node-forge 1.3.1

オープン
#1,117 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

  • #1153 @cpruijsen による — マージされずにクローズ

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
静か
技術スタック
javascript

調査の方向性

Start at the failing code location in dist/index.js around line 2126 and trace which node-forge 1.3.1 path constructs new URL(window.location.href). Check how that path is reached in a Tabris.js runtime and identify the environment-support condition described in the issue. Done means the application loads without this TypeError while browser behavior remains supported; no test file is named in the issue.

索引モデルが issue の本文から書いたものです。

説明

Environment:

Project type: Tabris.js (hybrid mobile framework using JavaScript)

Node version: 22.15.0

node-forge version: upgrading from 0.7.6 to 1.3.1

Problem:

After upgrading node-forge from version 0.7.6 to 1.3.1, the application fails to load and throws the following runtime error:

Could not load main module: TypeError: undefined is not a constructor (evaluating 'new URL(window.location.href)')
     at js (./dist/index.js:2126:5)
     at __webpack_require__ (./dist/index.js:6992:46)

This happens because window.location.href is not available in the Tabris.js runtime. These are browser-specific APIs and do not exist in Tabris.js or other hybrid environments.

The older version 0.7.6 works fine.

Expected Behavior:

The library should check if the environment supports these before using them. Please consider making the library more compatible with hybrid runtimes like Tabris.js.

主要言語
JavaScript
スター
5.4k
フォーク
875
平均マージ
3分
マージ済み PR(30日)
6

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

digitalbazaar/forge のほかの issue

digitalbazaar/forge の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。