Skye
02/21/2023, 6:00 PMconsole.error("renderToReadableStream error"); // Error thrown from here
console.error(error);
Which error is being thrown?sdev
02/21/2023, 6:12 PMconst data = useLoaderData<typeof loader>();
is not sent by Stream.sdev
02/21/2023, 6:13 PMdata.something
is undefined
. In Workers, it resolves to the value of the Promise.sdev
02/21/2023, 6:14 PMundefined
. Not sure if this comes from remix side or not.sdev
02/21/2023, 6:16 PMSkye
02/21/2023, 6:16 PMSkye
02/21/2023, 6:16 PMsdev
02/21/2023, 6:17 PMsdev
02/21/2023, 6:17 PMDani Foldi
02/21/2023, 6:46 PMDani Foldi
02/21/2023, 6:47 PMDani Foldi
02/21/2023, 6:48 PMsdev
02/21/2023, 7:03 PMDani Foldi
02/21/2023, 7:04 PMsdev
02/21/2023, 7:04 PMsdev
02/22/2023, 6:14 AMsdev
02/22/2023, 9:02 AMts
const octokit = new Octokit({ auth: gitHubToken });
Octokit relies on crypto
lib.HardAtWork
02/22/2023, 9:06 AMsdev
02/22/2023, 9:07 AMfetch
with Authorization: Bearer ${token}
right?HardAtWork
02/22/2023, 9:08 AMsdev
02/22/2023, 9:09 AMHardAtWork
02/22/2023, 9:11 AMsdev
02/22/2023, 9:17 AMsdev
02/22/2023, 1:27 PMts
const url = `https://api.github.com/repos/${owner}/${repo}/contents/${path}`;
const response = await fetch(url, {
method: "GET",
headers: {
Accept: "application/vnd.github+json",
Authorization: `Bearer ${token}`,
"X-GitHub-Api-Version": "2022-11-28",
},
});
I can use curl with my token to fetch content from a private repo. But when use fetch in Functions, I got Fobidden response.sdev
02/22/2023, 1:36 PMPause
02/22/2023, 6:30 PM_middleware.ts
, it also runs on GET requests for images and other assets... which causes those assets to fail to be delivered because HTMLRewriter can't rewrite an image.Pause
02/22/2023, 6:31 PMJames
02/22/2023, 7:22 PMconst asset = await next()
, check the headers of asset
for html content-type
, and then either run HTMLRewriter
, or just continueJames
02/22/2023, 7:22 PM