New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot make React 18 (production, UMD) work with SystemJS #2447
Comments
Topic is similar to #2389 |
Okay so after some random refresh in the browser, it turns out that the load order in which packages arrive seem to cause the issue. Some times the app works, sometimes MUI throws error and/or sometimes react-dom throws the error. I'll check if it's possible to define dependencies between dependencies and/or enforce a load order in systemjs. |
Okay, found the actual issue: I did not load Issue should be considered as RESOLVED. If anyone else faces similar issues in the future, they can check the demo repo at: https://github.com/noherczeg/system-react |
6.13.0
Question
I created a test repository: https://github.com/noherczeg/system-react where I wanted to play around with React 18 + SystemJS, but cannot make it work.
One of the main problems is that React moved away from the old jsx-runtime, and now it relies on compile-time magic in traditional (CJS-ish?) environments.
The current state of the demo repo produces "react-dom.production.min.js:218 Uncaught TypeError: Cannot read properties of undefined (reading '__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED')".
It is IMPORTANT to note, that our aim is to use the
production
version of both React and React DOM!I have identified two options which I could play with:
commonjs()
, andnodeResolve()
in the rollup configsexternal
section from the Rollup config.In the first scenario I get a runtime error of: "Uncaught (in promise) Error: Unable to resolve bare specifier 'react/jsx-runtime' from http://localhost:3000/index.js"
After this I "redundantly" added the following to the import map:
But then I get these errors:
(The second error comes from MUI)
This must be super simple to set up, but I spent 4 hours with this topic without success, can anyone please help me out?
Thanks,
Norbert
The text was updated successfully, but these errors were encountered: