Giter Club home page Giter Club logo

Comments (16)

ije avatar ije commented on May 27, 2024 1

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
Screenshot 2023-12-01 at 19 58 14

@xsjcTony @piscisaureus sorry for the breaking

from esm.sh.

ije avatar ije commented on May 27, 2024 1

already deployed, may need to clear the browser cache

from esm.sh.

yykamei avatar yykamei commented on May 27, 2024 1

🤔 I'm not sure that we can import react and react-dom from different sources.

from esm.sh.

piscisaureus avatar piscisaureus commented on May 27, 2024

Can confirm, it's happening for us (on Deno Deploy) too.

from esm.sh.

xsjcTony avatar xsjcTony commented on May 27, 2024

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.

piscisaureus avatar piscisaureus commented on May 27, 2024

Thank you for fixing it @ije !

from esm.sh.

xsjcTony avatar xsjcTony commented on May 27, 2024

Thanks. Any ETA on when will the fix be deployed?

from esm.sh.

wengtadashi avatar wengtadashi commented on May 27, 2024

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.

renhiyama avatar renhiyama commented on May 27, 2024

@wengtadashi you're suggested to use a pinned URL to avoid breaking changes

from esm.sh.

wengtadashi avatar wengtadashi commented on May 27, 2024

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.

xsjcTony avatar xsjcTony commented on May 27, 2024

@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.

yykamei avatar yykamei commented on May 27, 2024

@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.

xsjcTony avatar xsjcTony commented on May 27, 2024

@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.

yykamei avatar yykamei commented on May 27, 2024

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'
Screenshot 2023-12-05 at 16 45 43

from esm.sh.

xsjcTony avatar xsjcTony commented on May 27, 2024

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.

xsjcTony avatar xsjcTony commented on May 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.