TypeError: Invalid URL caused by mismatch in fetch()
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript, typescript
- 領域
- api
調査の方向性
まず libsql/isomorphic-fetch 0.1.12 と 0.2.0 の変更、特に commit 218800bd2c806e0f7537e427a516c04e4dede538 を比較します。fetchWithAgentSelection、@libsql/hrana-client、Remix の @remix-run/web-fetch を通過する Request を追跡します。Request が ERR_INVALID_URL を発生させずに処理されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the issue
Using Remix 2.9.2 with any version of libsql/client >= 0.6.0 results in the following error:
node:internal/url:814
const href = bindingUrl.parse(input, base, raiseException);
^
TypeError: Invalid URL
at new URL (node:internal/url:814:29)
at new Request (/home/ali/Desktop/remix-template-starter/node_modules/@remix-run/web-fetch/dist/lib.node.cjs:1437:16)
at /home/ali/Desktop/remix-template-starter/node_modules/@remix-run/web-fetch/dist/lib.node.cjs:1732:19
at new Promise (<anonymous>)
at fetch (/home/ali/Desktop/remix-template-starter/node_modules/@remix-run/web-fetch/dist/lib.node.cjs:1729:9)
at fetchWithAgentSelection (file:///home/ali/Desktop/remix-template-starter/node_modules/@libsql/isomorphic-fetch/node.js:19:12)
at #flush (file:///home/ali/Desktop/remix-template-starter/node_modules/@libsql/hrana-client/lib-esm/http/stream.js:245:23)
at #flushPipeline (file:///home/ali/Desktop/remix-template-starter/node_modules/@libsql/hrana-client/lib-esm/http/stream.js:233:20)
at #flushQueue (file:///home/ali/Desktop/remix-template-starter/node_modules/@libsql/hrana-client/lib-esm/http/stream.js:223:32)
at file:///home/ali/Desktop/remix-template-starter/node_modules/@libsql/hrana-client/lib-esm/http/stream.js:181:50 {
code: 'ERR_INVALID_URL',
input: '[object Request]'
}
Downgrading to libsql/client 0.5.6 fixes the issue, as discovered by the following issues:
https://github.com/tursodatabase/libsql-client-ts/issues/204
https://github.com/prisma/prisma/issues/23774
However, after investigating, I've noticed that the issue isn't due to using a version of libsql/client >= 0.6.0, as I was able to use 0.6.2 with the condition that I downgrade libsql/isomorphic-fetch to 0.1.12 which is a dependency of @libsql/hrana-client which is a dependency of libsql/client. I've then started looking at the changes between libsql/isomorphic-fetch 0.1.12 and 0.2.0, which is just this 1 commit thankfully: https://github.com/libsql/isomorphic-ts/commit/218800bd2c806e0f7537e427a516c04e4dede538
And what I've noticed is that now, we are passing the entire Request object as the first argument to the fetch function, going back at the error mentioned above, specifically this one here:
at fetch (/home/ali/Desktop/remix-template-starter/node_modules/@remix-run/web-fetch/dist/lib.node.cjs:1729:9)
What is happening here is that the fetch function from @remix-run/web-fetch, tries to treat it as a string URL, leading to the ERR INVALID URL error, because we are trying to pass it the entire Request object:
input: '[object Request]'
- 主要言語
- JavaScript
- スター
- 2
- フォーク
- 5
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
libsql/isomorphic-ts のほかの issue
-
enhancement good first issue help wanted
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
libsql/isomorphic-ts#12 ·
-
enhancement good first issue help wanted
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
libsql/isomorphic-ts#6 · コメント 1 件 · リアクション 1 件 ·
libsql/isomorphic-ts の issue をすべて見る
似ている issue
-
bug release:v5.56
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Jason-Vaughan/TangleClaw#2270 ·
メンテナーはふだん 1 日以内に返信
-
priority: medium tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
LeeAdcock/robocodeJs.com#411 ·
メンテナーはふだん 1 日以内に返信
-
status: needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
mastra-ai/mastra#26635 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
chore good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
pedrorchagas/blog-api#21 ·