Closed KyleJune closed 1 year ago
not sure what happened, but i just re-deployed the CF worker, now it works. fyi, i added this URL in the checker script:
It appears that I still have an issue where it keeps re-downloading it like shown in the video even though the links work in the browser for me. I'm not sure why, maybe that's a deno issue.
When I download the v110 file, it looks right, it's just a file that imports './index.d.ts'. But if I look at the response in firefox dev tools, it shows a base64 representation of the file. I'm not sure if it's related but maybe that's why deno isn't able to use it now that the URL works.
Ly8gRXhwb3NlIGBKU1hgIG5hbWVzcGFjZSBpbiBgZ2xvYmFsYCBuYW1lc3BhY2UKaW1wb3J0ICcuL2luZGV4LmQudHMnOwo
I tried updating to v111 to see if that works but it fails like v110 was for me before.
Github won't let me re-open the issue but I think it should be re-opened.
seems the CF worker has issue with R2, i switch to KV storage for these .dts
files
finally i found CF worker can not handle origin server redirect correctly, fixed this issue after adding redirect: manual
I've confirmed your change resolved the issue. It doesn't keep trying to download it again each time I run the script anymore. Thank you
thanks for reporting, a huge help
The import map has the following entries for react. It tries pinning to 18.2.0 but the types version ends up being different.
The deno.jsonc file has the following compiler options for deno to use the jsx-runtime.
You can reproduce the issue by checking out the github repository linked at the top of this issue and running the command
deno task dev
. Every time the application runs or reloads, it ends up trying to download the types again.Evidence
In the following video, you can see that each time the application runs it downloads the react types multiple times.
https://user-images.githubusercontent.com/3241653/226081510-155fcfdb-f429-427a-9578-e0db98c82f3d.mp4
These are the URLs you can see it repeatedly downloading.
https://esm.sh/v110/@types/react@^18/jsx-runtime~.d.ts https://esm.sh/v110/@types/react@18.0.26/jsx-runtime~.d.ts
The first url redirects to the second. Then the second fails with a 522 error from cloudflare. You can see that in the following screenshot of dev tools.
Additional info