-
Notifications
You must be signed in to change notification settings - Fork 46.8k
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: React DevTools throws ReferenceError: regeneratorRuntime is not defined #19756
Comments
The code you post catches this error. Are you saying that the code should not have caught exceptions? I don't find this reasonable to expect. React has a couple of instances where it attempts "something" and catches a potential error. You're essentially demanding that nobody should ever catch errors since that hinders your debug workflow. |
The |
Then I don't understand why that block would be wrapped in a try-catch |
Okay, so, I don't know what target the React Dev Tools have in mind for browser compatibility but the |
we can suppress this error, can we? |
DevTools backend uses the Contributions would be welcome if you'd like to change the Babel config for the extension (and ensure that things still work). |
I like to give a try, Fingers crossed |
|
for me its not coming in even catch block
|
Note that you have to enable "Pause on caught exceptions" in the script debugger. |
What's the min spec? Is okay to assume a modern browser (with built in support for async/await)? |
for me its at,
at one place e.stack getting undefined and keep throwing exceptions... |
Yes, async/await and generators are supported by all browsers this extension targets (and all semi recent versions of Node that the standalone version targets). |
After some digging around it looks to me that the min spec is actually given by the manifest files in But... there are additional targets to consider. [packages\react-devtools-shared\babel.config.js]: if (isTest) {
targets.node = 'current';
} else {
targets.chrome = minChromeVersion.toString();
targets.firefox = minFirefoxVersion.toString();
// This targets RN/Hermes.
targets.ie = '11';
} If the lowest common denominator is going to be IE11 due to Hermes then I don't think messing with the targets will help. It is possible to do things like So, this: return {
plugins,
presets: [
['@babel/preset-env', {targets}],
'@babel/preset-react',
'@babel/preset-flow',
],
}; Changes into... return {
plugins,
presets: [
['@babel/preset-env', {targets, exclude: ['transform-regenerator']}],
'@babel/preset-react',
'@babel/preset-flow',
],
}; But now I'm uncertain what's going to happen if this code really needs to include a regenerator runtime for Hermes support. |
True, although I think this is because we could target that min spec, not because we actually need to (or even care to). The question about Hermes is a good one though! We could fork the Babel configs so that the inline and the browser extension packages inject the exclude. |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
React Developer Tools 4.10.1 (12/4/2020) — still reproducible Could it be possible to do conditional check on babel internals to avoid try/catch, e.g.
? |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you! |
React version: 16.3.1
Steps To Reproduce
The current behavior
The source of this error seems to be something like this:
From
chrome-extension://fmkadmapgofadopljbjfkapdkoienihi/build/react_devtools_backend.js
The expected behavior
No errors are thrown. It's really annoying when React or it's tooling is throwing exceptions because it makes me having to step through a lot of noise when I'm debugging my own stuff. If this could be avoided that would be much appreciated.
I get that his might not be fixable and if so, feel free to close but please keep it in mind. Please don't throw exceptions if you absolutely musn't.
The text was updated successfully, but these errors were encountered: