When compilation fails (error due to a bug in flow parser, tracked in https://github.com/facebook/flow/pull/9208), the "Compile Analysis -> Loaders Analysis -> Loaders Analysis" panel displays a malformed editor for the file causing the error. The height of this editor is set to just a few pixels, as well as the contents seem to be invalid. At the same time, side-by-side editors for other files work properly.
Screenshot of the error in CLI when building:
Screenshot of rsdoctor GUI:
...and monaco editor container in rsdoctor's GUI, in the elements inspector:
(note to the above screen: more elements have this faulty height)
The faulty contents (editor resized manually in elements inspector to show the actual contents) seem to be the partially-transformed file, but uppercase, and a stack trace of the parser error below it:
[Error:/**
* COPYRIGHT (C) META PLATFORMS, INC. AND AFFILIATES.
*
* THIS SOURCE CODE IS LICENSED UNDER THE MIT LICENSE FOUND IN THE
* LICENSE FILE IN THE ROOT DIRECTORY OF THIS SOURCE TREE.
*
* @FLOW STRICT-LOCAL
* @FORMAT
*/
IMPORT TYPE {EVENTSUBSCRIPTION} FROM '../../../LIBRARIES/VENDOR/EMITTER/EVENTEMITTER';
IMPORT TYPE {EVENTCONFIG} FROM '../../../LIBRARIES/ANIMATED/ANIMATEDEVENT';
IMPORT TYPE {
ANIMATIONCONFIG,
ENDCALLBACK,
} FROM '../../../LIBRARIES/ANIMATED/ANIMATIONS/ANIMATION';
IMPORT TYPE {
ANIMATEDNODECONFIG,
EVENTMAPPING,
} FROM '../../../LIBRARIES/ANIMATED/NATIVEANIMATEDMODULE';
IMPORT * AS REACTNATIVEFEATUREFLAGS FROM '../FEATUREFLAGS/REACTNATIVEFEATUREFLAGS';
IMPORT NATIVEEVENTEMITTER FROM '../../../LIBRARIES/EVENTEMITTER/NATIVEEVENTEMITTER';
IMPORT RCTDEVICEEVENTEMITTER FROM '../../../LIBRARIES/EVENTEMITTER/RCTDEVICEEVENTEMITTER';
IMPORT PLATFORM FROM '../../../LIBRARIES/UTILITIES/PLATFORM';
IMPORT NATIVEANIMATEDNONTURBOMODULE FROM '../../../LIBRARIES/ANIMATED/NATIVEANIMATEDMODULE';
IMPORT NATIVEANIMATEDTURBOMODULE FROM '../../../LIBRARIES/ANIMATED/NATIVEANIMATEDTURBOMODULE';
IMPORT INVARIANT FROM 'INVARIANT';
IMPORT NULLTHROWS FROM 'NULLTHROWS';
// TODO T69437152 @PETETHEHEAT - DELETE THIS FORK WHEN FABRIC SHIPS TO 100%.
CONST NATIVEANIMATEDMODULE: TYPEOF NATIVEANIMATEDTURBOMODULE =
NATIVEANIMATEDNONTURBOMODULE ?? NATIVEANIMATEDTURBOMODULE;
LET __NATIVEANIMATEDNODETAGCOUNT = 1; /* USED FOR ANIMATED NODES */
LET __NATIVEANIMATIONIDCOUNT = 1; /* USED FOR STARTED ANIMATIONS */
LET NATIVEEVENTEMITTER;
LET WAITINGFORQUEUEDOPERATIONS = NEW SET<STRING>();
[...]
[0m [90m 136 |[39m [33m:[39m (tag[33m,[39m saveValueCallback) [33m=>[39m {
[90m 137 |[39m [33mNativeOperations[39m[33m.[39mgetValue(tag[33m,[39m saveValueCallback)[33m;[39m
[31m[1m>[22m[39m[90m 138 |[39m }) [36mas[39m $NonMaybeType[33m<[39m[36mtypeof[39m [33mNativeAnimatedModule[39m[33m>[39m[[32m'getValue'[39m][33m,[39m
[90m |[39m [31m[1m^[22m[39m
[90m 139 |[39m
[90m 140 |[39m setWaitingForIdentifier(id[33m:[39m string)[33m:[39m [36mvoid[39m {
[90m 141 |[39m waitingForQueuedOperations[33m.[39madd(id)[33m;[39m[0m
Error Stack:
SyntaxError: /substituted/path/to/my/project/node_modules/.pnpm/react-native@0.76.0-rc.1_@babel+core@7.25.2_@babel+preset-env@7.25.4_@babel+core@7.25.2__@rea_vlse775u3jppwlbpw3wmuggq3u/node_modules/react-native/src/private/animated/NativeAnimatedHelper.js: Unexpected token, expected "," (138:9)
[0m [90m 136 |[39m [33m:[39m (tag[33m,[39m saveValueCallback) [33m=>[39m {
[90m 137 |[39m [33mNativeOperations[39m[33m.[39mgetValue(tag[33m,[39m saveValueCallback)[33m;[39m
[31m[1m>[22m[39m[90m 138 |[39m }) [36mas[39m $NonMaybeType[33m<[39m[36mtypeof[39m [33mNativeAnimatedModule[39m[33m>[39m[[32m'getValue'[39m][33m,[39m
[90m |[39m [31m[1m^[22m[39m
[90m 139 |[39m
[90m 140 |[39m setWaitingForIdentifier(id[33m:[39m string)[33m:[39m [36mvoid[39m {
[90m 141 |[39m waitingForQueuedOperations[33m.[39madd(id)[33m;[39m[0m
at constructor
[...]
Version
Details
When compilation fails (error due to a bug in flow parser, tracked in https://github.com/facebook/flow/pull/9208), the "Compile Analysis -> Loaders Analysis -> Loaders Analysis" panel displays a malformed editor for the file causing the error. The height of this editor is set to just a few pixels, as well as the contents seem to be invalid. At the same time, side-by-side editors for other files work properly.
Screenshot of the error in CLI when building:
Screenshot of rsdoctor GUI:
...and monaco editor container in rsdoctor's GUI, in the elements inspector:
(note to the above screen: more elements have this faulty height)
The faulty contents (editor resized manually in elements inspector to show the actual contents) seem to be the partially-transformed file, but uppercase, and a stack trace of the parser error below it:
Reproduce link
https://github.com/callstack/repack/commit/bdd10466aacc05722961c1722bc063a1d84fac04
Reproduce Steps
pnpm i
cd apps/tester-app
RSDOCTOR=1 pnpm start --platform ios