question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generates invalid output with certain properties

See original GitHub issue

The React team encountered an issue with Closure Compiler when compiling the React DOM bundle. It’s quite specific, but it seems to somehow confuse the compiler into re-using a variable that is not safe to use given a given scenario.

https://github.com/facebook/react/pull/18670#issuecomment-623481140

Reproduction steps:

This error should be seen:

TypeError: Cannot read property 'focusedElem' of null. It seems to be related to JSCompiler_inline_result. Which incorrectly gets re-used from a null value.

Specifically, the change that causes this is when we convert this logic:

function prepareForCommit(containerInfo) {
  ...
}
...
prepareForCommit(root.containerInfo);

to:

function prepareForCommit(containerInfo) {
  ...
  return null;
}
...
prepareForCommit(root.containerInfo) || null;

These are the flags we use for this particular build:

compilation_level: 'SIMPLE'
language_in: 'ECMASCRIPT_2015'
language_out: 'ECMASCRIPT5_STRICT'
env: 'CUSTOM'
warning_level: 'QUIET'
apply_input_source_maps: false
use_types_for_optimization: false
process_common_js_modules: false
rewrite_polyfills: false
inject_libraries: false
assume_function_wrapper: true

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:29 (26 by maintainers)

github_iconTop GitHub Comments

1reaction
blicklycommented, Feb 3, 2021

Ok, great, thanks for catching that!

Then the actual repro steps are:

git clone https://github.com/trueadm/react.git
cd react/
git checkout break-gcc
yarn install --ignore-engines
yarn build --type=NODE_PROD
yarn test-prod-build ReactDOMServerIntegrationTextarea

And that does give the expected error, namely (several) failed tests with:

 TypeError: Cannot read property 'focusedElem' of null
0reactions
gaearoncommented, Apr 3, 2022

For posterity, here’s the likely cause: https://github.com/rollup/rollup/issues/4455

Read more comments on GitHub >

github_iconTop Results From Across the Web

The OutputPath property is not set for project - Stack Overflow
I got this error only when I was publishing my web project. I had mistakenly selected the wrong build configuration when setting up...
Read more >
Invalid Property Value Error - OutSystems 10 Documentation
You have a mandatory property for which the value is no longer available or is invalid. For example, an Execute Action whose Action...
Read more >
Resolve the error "unable to create input format" in Amazon ...
To resolve this error, use a data type that is supported by a built-in classifier. If the data format can't be classified by...
Read more >
Azure Stream Analytics resource log data errors
This article explains the different input and output data errors that can occur when using Azure Stream Analytics.
Read more >
xf-dev:entity-class-properties generates invalid output - XenForo
This function has entirely broken in XF 2.2.7. In PHP 7.4 it generates the following output: ErrorException: [E_DEPRECATED] Function...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found