Skip to content
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

Bug: Cannot read property __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED of undefined #21390

Closed
code913 opened this issue Apr 29, 2021 · 3 comments
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@code913
Copy link

code913 commented Apr 29, 2021

I got this issue when using react in deno deploy, but i think it will still throw this error in nodejs

Code: https://github.com/code913/react-ssr-deno

what the heck is this tbh

React version: 17.0.2 react-dom, react version latest

Steps To Reproduce

  1. Import react-dom from the umd production or development url (havent tested others): https://cdnjs.cloudflare.com/ajax/libs/react-dom/17.0.2/umd/react-dom.development.min.js
  2. Try to hydrate some data from react-dom/server
@code913 code913 added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Apr 29, 2021
@code913 code913 changed the title Bug: Cannot read property __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED property read of undefined Bug: Cannot read property __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED of undefined Apr 29, 2021
@code913
Copy link
Author

code913 commented Apr 29, 2021

Oh btw if you wanna see this in action go here: https://react-ssr-deno-b539c876.deno.dev

@lucacasonato
Copy link

This issue is invalid. OP is not importing "react".

@bvaughn
Copy link
Contributor

bvaughn commented Apr 29, 2021

__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED is a property of the React export. The error message indicates that React isn't being imported or bundled with the app you're referring to.

The source code of the application you linked to tries to find React as a global:

require("react")

Looking at your source though, you're only including react-dom:

<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/17.0.2/umd/react-dom.development.min.js" integrity="sha512-aNBFq6ue8EmNDwVD/l0mWFy3iVZLIxtQaD7fEYBn3HluJer36T1AhJK0THj6MKKfhZrexxWsKX1T16TxLZo6uQ==" crossorigin="anonymous"></script>

You'll need to add a <script> tag for React too, and load it before react-dom.

@bvaughn bvaughn closed this as completed Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

3 participants