Comments (16)
what happened?
i removed a line that adds ?target
param to the cache key that is used as the store key of KV/R2 in recent dumb refactor (2305011#diff-e9539f59664c8ae83b837c70056b40427c1041359a3102cb2650a9abb5dc5360L75), and today i deployed it accidentally
then the react(others have same issue) url is redirected to /stable/[email protected]/es2021/react.mjs
(latest cache in the storage), no matter what the user-agent
is. but react-dom still uses /stable/[email protected]/es2022/react.mjs
that impors multiple copy of react (different urls)
how it be fixed?
- reverted the change
- purge the cloudflare cache
- added unit testings for different UAs
- status page added testings for this secnarios
@xsjcTony @piscisaureus sorry for the breaking
from esm.sh.
already deployed, may need to clear the browser cache
from esm.sh.
🤔 I'm not sure that we can import react
and react-dom
from different sources.
from esm.sh.
Can confirm, it's happening for us (on Deno Deploy) too.
from esm.sh.
I'm just scared... When a library that the whole page is built on will be suddenly broken during daytime... I might not use CDN for critical packages anymore😭
from esm.sh.
Thank you for fixing it @ije !
from esm.sh.
Thanks. Any ETA on when will the fix be deployed?
from esm.sh.
Hello,
When we encountered this issue, we switched to the development version of React and it resolved the problem! Therefore, I'm contemplating whether adding a pin to the URL could safeguard our service from these types of issues in the future. Does this sound correct?
from esm.sh.
@wengtadashi you're suggested to use a pinned URL to avoid breaking changes
from esm.sh.
I understand that's how a pinned URL functions. However, I would like to know if a pinned URL would have prevented this specific issue at the time it occurred.
from esm.sh.
@ije Sorry, is this really deployed? If you open the playground above (the stackblitz link), it's still not working no matter what I do.
By visiting the esm.sh/react
straight away, it's still the old bugged version.
from esm.sh.
@xsjcTony Hi, did you try it with the browser cache disabled? If your browser caches the broken modules, the problem would still happen. I confirmed it worked after super reloading my browser.
from esm.sh.
@yykamei Yes I've disabled all caches, and even tried with other browsers like Edge, firefox, and in Incognito Mode as well. None of them works.
https://stackblitz.com/edit/vitejs-vite-qsenfs?file=src%2FApp.tsx
https://esm.sh/stable/[email protected]/es2022/react.mjs still includes var l={current:null}
from esm.sh.
I looked into your code on StackBlitz and found out you are using react-dom
from package.json
. After changing the line in main.tsx
like this, the code worked as expected. Maybe, it would be necessary to confirm you are importing react
and react-dom
from esm.sh.
- import ReactDOM from 'react-dom/client'
+ import ReactDOM from 'https://esm.sh/react-dom/client'
from esm.sh.
That's actually correct but why?... It doesn't make sense to me, since one should be able to import any packages by cdn and other packages bundled right? If that's the case, maybe all related packages either need to be all imported by CDN or all bundled?
from esm.sh.
I think it's a total valid use case, say I want to import react
via CDN, and bundle react-dom
myself right? and I don't see a reason it should break. Maybe I'm missing something but that's kinda weird.
from esm.sh.
Related Issues (20)
- Wrong X-Typescript-Types url for `@vueuse/shared` HOT 1
- Failed to import - primereact (alias cannot contain slashes) HOT 2
- Feature request - download lists HOT 5
- Invalid response status code
- Failed to import - @mui/icons-material/DeleteOutline HOT 1
- Failed to init CLI on Deno HOT 1
- Feature request - SSE for package new version HOT 2
- No versions available for esm-node-services HOT 9
- "esmLexer: invalid syntax, require javascript/typescript" on valid file HOT 5
- Not possible to import a React client component in Next.JS via esm.sh
- Use custom node polyfill via `alias` and `external` query
- @observablehq/plot prototypes are missing a method due to skipped side effects
- Support GitHub Gists
- Failed to import - d3 HOT 1
- Failed init cli on NPM HOT 7
- Support importing modules from jsr.io HOT 1
- how to get react profiling version
- Failed to import - basehub/react - shows 500 Internal Server Error. - on commit
- Failed to import - @mui/material HOT 6
- Failed to import - openlayers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esm.sh.