Skip to content

Instantly share code, notes, and snippets.

@passy
Created August 2, 2019 08:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save passy/1cf4d56eb2f252cc09292c62f87da0b0 to your computer and use it in GitHub Desktop.
Save passy/1cf4d56eb2f252cc09292c62f87da0b0 to your computer and use it in GitHub Desktop.
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/ManageMockResponsePanel.js:22:9
Cannot import the type Route as a value. Use import type instead.
19│ ContextMenu,
20│ } from 'flipper';
21│
22│ import {Route} from './types';
23│
24│ import {MockResponseDetails} from './MockResponseDetails';
25│ import type {RequestId} from './types';
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/ManageMockResponsePanel.js:109:13
Cannot assign object literal to this.state because array literal [1] has an arity of 1 but tuple type [2] has an arity
of 0 in property selectedIds.
[2] 33│ selectedIds: [],
:
103│
104│ constructor(props: Props) {
105│ super(props);
106│ this.state = {
107│ selectedIds:
108│ this.props.routes !== undefined && this.props.routes.length > 0
[1] 109│ ? [0]
110│ : [],
111│ };
112│ }
113│
114│ deleteRoute = () => {
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/ManageMockResponsePanel.js:116:51
Cannot get selectedIds[0] because tuple type [1] only has 0 elements, so index 0 is out of bounds.
[1] 33│ selectedIds: [],
:
113│
114│ deleteRoute = () => {
115│ const {selectedIds} = this.state;
116│ const selectedId = selectedIds.length === 1 ? selectedIds[0] : null;
117│ const routes = this.props.routes;
118│ routes.splice(selectedId, 1);
119│
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/ManageMockResponsePanel.js:118:19
Cannot call routes.splice with selectedId bound to start because:
• undefined (out of bounds tuple access) [1] is incompatible with number [2].
• null [3] is incompatible with number [2].
src/plugins/network/ManageMockResponsePanel.js
115│ const {selectedIds} = this.state;
[1][3] 116│ const selectedId = selectedIds.length === 1 ? selectedIds[0] : null;
117│ const routes = this.props.routes;
118│ routes.splice(selectedId, 1);
119│
120│ this.checkDuplicate(routes);
121│
/private/tmp/flow/flowlib_1c80054e/core.js
[2] 291│ splice(start: number, deleteCount?: number, ...items: Array<T>): Array<T>;
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/ManageMockResponsePanel.js:181:25
Cannot call this.checkDuplicate with newRoutes bound to routes because:
• property data is missing in object literal [1] but exists in Route [2] in array element.
• property headers is missing in object literal [1] but exists in Route [2] in array element.
• property isDuplicate is missing in object literal [1] but exists in Route [2] in array element.
[2] 162│ checkDuplicate = (routes: Route[]) => {
:
[1] 175│ const route = {
176│ requestUrl: '/',
177│ method: 'GET',
178│ };
179│ const newRoutes = [...this.props.routes, route];
180│
181│ this.checkDuplicate(newRoutes);
182│
183│ this.props.handleRoutesChange(newRoutes);
184│
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/ManageMockResponsePanel.js:183:35
Cannot call this.props.handleRoutesChange with newRoutes bound to routes because:
• property data is missing in object literal [1] but exists in Route [2] in array element.
• property headers is missing in object literal [1] but exists in Route [2] in array element.
• property isDuplicate is missing in object literal [1] but exists in Route [2] in array element.
[2] 29│ handleRoutesChange: (routes: Route[]) => void,
:
[1] 175│ const route = {
176│ requestUrl: '/',
177│ method: 'GET',
178│ };
179│ const newRoutes = [...this.props.routes, route];
180│
181│ this.checkDuplicate(newRoutes);
182│
183│ this.props.handleRoutesChange(newRoutes);
184│
185│ this.setState({
186│ selectedIds: [newRoutes.length - 1],
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/ManageMockResponsePanel.js:186:20
Cannot call this.setState with object literal bound to partialState because array literal [1] has an arity of 1 but
tuple type [2] has an arity of 0.
[2] 33│ selectedIds: [],
:
182│
183│ this.props.handleRoutesChange(newRoutes);
184│
185│ this.setState({
[1] 186│ selectedIds: [newRoutes.length - 1],
187│ });
188│ };
189│
190│ onRowHighlighted = (selectedIds: Array<RequestId>) =>
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/ManageMockResponsePanel.js:191:19
Cannot call this.setState with object literal bound to partialState because array type [1] has an unknown number of
elements, so is incompatible with tuple type [2] in property selectedIds.
[2] 33│ selectedIds: [],
:
188│ };
189│
[1] 190│ onRowHighlighted = (selectedIds: Array<RequestId>) =>
191│ this.setState({selectedIds: selectedIds});
192│
193│ handleRouteChange = (selectedId: RequestId, route: Route) => {
194│ const routes = this.props.routes;
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/ManageMockResponsePanel.js:197:5
Cannot assign route to routes[selectedId] because string [1] is not an array index.
[1] 193│ handleRouteChange = (selectedId: RequestId, route: Route) => {
194│ const routes = this.props.routes;
195│
196│ // Set route
197│ routes[selectedId] = route;
198│
199│ // Check duplicate
200│ this.checkDuplicate(routes);
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/ManageMockResponsePanel.js:203:7
Cannot call this.setState with object literal bound to partialState because:
• Either property routes is missing in State [1] but exists in object literal [2].
• Or a call signature declaring the expected parameter / return type is missing in object literal [2] but exists in
function type [3].
src/plugins/network/ManageMockResponsePanel.js
[1] 87│ export class ManageMockResponsePanel extends Component<Props, State> {
:
200│ this.checkDuplicate(routes);
201│
202│ this.setState(
[2] 203│ {
204│ routes: routes,
205│ },
206│ () => {
207│ this.props.handleRoutesChange(routes);
208│ },
/private/tmp/flow/flowlib_1c80054e/react.js
[3] 35│ partialState: ?$Shape<State> | ((State, Props) => ?$Shape<State>),
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/ManageMockResponsePanel.js:215:51
Cannot get selectedIds[0] because tuple type [1] only has 0 elements, so index 0 is out of bounds.
[1] 33│ selectedIds: [],
:
212│ renderSidebar = () => {
213│ const {selectedIds} = this.state;
214│ const {routes} = this.props;
215│ const selectedId = selectedIds.length === 1 ? selectedIds[0] : null;
216│
217│ return selectedId != null ? (
218│ <Panel
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/ManageMockResponsePanel.js:227:30
Cannot create MockResponseDetails element because undefined [1] is incompatible with object type [2] in the return value
of property handleRouteChange.
src/plugins/network/ManageMockResponsePanel.js
[1] 193│ handleRouteChange = (selectedId: RequestId, route: Route) => {
:
220│ collapsable={false}
221│ floating={false}
222│ heading={'Route Info'}>
223│ <MockResponseDetails
224│ key={selectedId}
225│ id={selectedId}
226│ route={routes[selectedId]}
227│ handleRouteChange={this.handleRouteChange}
228│ />
229│ </Panel>
230│ ) : null;
231│ };
src/plugins/network/MockResponseDetails.js
[2] 31│ handleRouteChange: (selectedId: RequestId, route: Route) => {},
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/MockResponseDetails.js:151:11
Cannot extend Component [1] with MockResponseDetails because property selectedHeaderIds is missing in object literal [2]
but exists in State [3] in property state.
147│ flex: 1,
148│ });
149│
[1][3] 150│ export class MockResponseDetails extends Component<Props, State> {
[2] 151│ state = {
152│ activeTab: 'data',
153│ };
154│
155│ updateRouteChange = (route: Route) => {
156│ this.props.handleRouteChange(this.props.id, route);
157│ };
158│
159│ handleMethodSelectChange = (text: string) => {
160│ const route = this.props.route;
161│ route.method = text;
162│ this.updateRouteChange(route);
163│ };
164│
:
356│ <AddHeaderButton onClick={this.addRow}>
357│ <Glyph
358│ name="plus-circle"
359│ size={16}
360│ variant="outline"
361│ color={colors.blackAlpha30}
362│ />
363│ &nbsp;Add Header
364│ </AddHeaderButton>
365│ </Tab>
366│ </Tabs>
367│ </Container>
368│ );
369│ }
370│ }
371│
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/MockResponseDetails.js:165:26
Missing type annotation for event.
162│ this.updateRouteChange(route);
163│ };
164│
165│ handleURLInputChange = event => {
166│ const route = this.props.route;
167│ route.requestUrl = event.target.value;
168│ this.updateRouteChange(route);
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/MockResponseDetails.js:171:30
Missing type annotation for event.
168│ this.updateRouteChange(route);
169│ };
170│
171│ handleDataTextAreaChange = event => {
172│ const route = this.props.route;
173│ route.data = event.target.value;
174│ this.updateRouteChange(route);
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/MockResponseDetails.js:177:28
Missing type annotation for event.
174│ this.updateRouteChange(route);
175│ };
176│
177│ handleHeaderNameChange = event => {
178│ const route = this.props.route;
179│ const {selectedHeaderIds} = this.state;
180│ const selectedId =
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/MockResponseDetails.js:179:12
Property selectedHeaderIds is missing in object literal [1].
[1] 151│ state = {
152│ activeTab: 'data',
153│ };
:
176│
177│ handleHeaderNameChange = event => {
178│ const route = this.props.route;
179│ const {selectedHeaderIds} = this.state;
180│ const selectedId =
181│ selectedHeaderIds.length === 1 ? selectedHeaderIds[0] : null;
182│ route.headers[selectedId].key = event.target.value;
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/MockResponseDetails.js:181:40
Cannot get selectedHeaderIds[0] because tuple type [1] only has 0 elements, so index 0 is out of bounds.
[1] 36│ selectedHeaderIds: [],
:
178│ const route = this.props.route;
179│ const {selectedHeaderIds} = this.state;
180│ const selectedId =
181│ selectedHeaderIds.length === 1 ? selectedHeaderIds[0] : null;
182│ route.headers[selectedId].key = event.target.value;
183│ this.updateRouteChange(route);
184│ };
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/MockResponseDetails.js:182:5
Cannot get route.headers[selectedId] because:
• undefined (out of bounds tuple access) [1] is not an array index.
• null [2] is not an array index.
179│ const {selectedHeaderIds} = this.state;
180│ const selectedId =
[1][2] 181│ selectedHeaderIds.length === 1 ? selectedHeaderIds[0] : null;
182│ route.headers[selectedId].key = event.target.value;
183│ this.updateRouteChange(route);
184│ };
185│
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/MockResponseDetails.js:186:29
Missing type annotation for event.
183│ this.updateRouteChange(route);
184│ };
185│
186│ handleHeaderValueChange = event => {
187│ const route = this.props.route;
188│ const {selectedHeaderIds} = this.state;
189│ const selectedId =
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/MockResponseDetails.js:188:12
Property selectedHeaderIds is missing in object literal [1].
[1] 151│ state = {
152│ activeTab: 'data',
153│ };
:
185│
186│ handleHeaderValueChange = event => {
187│ const route = this.props.route;
188│ const {selectedHeaderIds} = this.state;
189│ const selectedId =
190│ selectedHeaderIds.length === 1 ? selectedHeaderIds[0] : null;
191│ route.headers[selectedId].value = event.target.value;
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/MockResponseDetails.js:190:40
Cannot get selectedHeaderIds[0] because tuple type [1] only has 0 elements, so index 0 is out of bounds.
[1] 36│ selectedHeaderIds: [],
:
187│ const route = this.props.route;
188│ const {selectedHeaderIds} = this.state;
189│ const selectedId =
190│ selectedHeaderIds.length === 1 ? selectedHeaderIds[0] : null;
191│ route.headers[selectedId].value = event.target.value;
192│ this.updateRouteChange(route);
193│ };
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/MockResponseDetails.js:191:5
Cannot get route.headers[selectedId] because:
• undefined (out of bounds tuple access) [1] is not an array index.
• null [2] is not an array index.
188│ const {selectedHeaderIds} = this.state;
189│ const selectedId =
[1][2] 190│ selectedHeaderIds.length === 1 ? selectedHeaderIds[0] : null;
191│ route.headers[selectedId].value = event.target.value;
192│ this.updateRouteChange(route);
193│ };
194│
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/MockResponseDetails.js:196:19
Cannot call this.setState with object literal bound to partialState because array type [1] has an unknown number of
elements, so is incompatible with tuple type [2] in property selectedHeaderIds.
[2] 36│ selectedHeaderIds: [],
:
193│ };
194│
[1] 195│ onRowHighlighted = (selectedIds: Array<RequestId>) =>
196│ this.setState({selectedHeaderIds: selectedIds});
197│
198│ onActive = (key: ?string) => {
199│ this.setState({
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/MockResponseDetails.js:199:19
Cannot call this.setState with object literal bound to partialState because null or undefined [1] is incompatible with
string [2] in property activeTab.
[2] 35│ activeTab: string,
:
196│ this.setState({selectedHeaderIds: selectedIds});
197│
[1] 198│ onActive = (key: ?string) => {
199│ this.setState({
200│ activeTab: key,
201│ });
202│ };
203│
204│ buildRows = () => {
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/MockResponseDetails.js:217:12
Property selectedHeaderIds is missing in object literal [1].
[1] 151│ state = {
152│ activeTab: 'data',
153│ };
:
214│ };
215│
216│ buildRow = (header: Header, index: number) => {
217│ const {selectedHeaderIds} = this.state;
218│ const selectedId = selectedHeaderIds
219│ ? selectedHeaderIds.length === 1
220│ ? selectedHeaderIds[0]
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/MockResponseDetails.js:220:11
Cannot get selectedHeaderIds[0] because tuple type [1] only has 0 elements, so index 0 is out of bounds.
[1] 36│ selectedHeaderIds: [],
:
217│ const {selectedHeaderIds} = this.state;
218│ const selectedId = selectedHeaderIds
219│ ? selectedHeaderIds.length === 1
220│ ? selectedHeaderIds[0]
221│ : null
222│ : 0;
223│ return {
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/MockResponseDetails.js:281:12
Property selectedHeaderIds is missing in object literal [1].
[1] 151│ state = {
152│ activeTab: 'data',
153│ };
:
278│ deleteRow = () => {
279│ const route = this.props.route;
280│ const headers = route.headers;
281│ const {selectedHeaderIds} = this.state;
282│ const selectedId = selectedHeaderIds
283│ ? selectedHeaderIds.length === 1
284│ ? selectedHeaderIds[0]
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/MockResponseDetails.js:284:11
Cannot get selectedHeaderIds[0] because tuple type [1] only has 0 elements, so index 0 is out of bounds.
[1] 36│ selectedHeaderIds: [],
:
281│ const {selectedHeaderIds} = this.state;
282│ const selectedId = selectedHeaderIds
283│ ? selectedHeaderIds.length === 1
284│ ? selectedHeaderIds[0]
285│ : null
286│ : 0;
287│ headers.splice(selectedId, 1);
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/MockResponseDetails.js:287:20
Cannot call headers.splice with selectedId bound to start because:
• undefined (out of bounds tuple access) [1] is incompatible with number [2].
• null [3] is incompatible with number [2].
src/plugins/network/MockResponseDetails.js
[1] 284│ ? selectedHeaderIds[0]
[3] 285│ : null
286│ : 0;
287│ headers.splice(selectedId, 1);
288│ route.headers = headers;
289│ this.updateRouteChange(route);
290│ };
/private/tmp/flow/flowlib_1c80054e/core.js
[2] 291│ splice(start: number, deleteCount?: number, ...items: Array<T>): Array<T>;
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/index.js:119:54
Cannot extend FlipperPlugin [1] with .*default* because property isMockResponseSupported is missing in
PersistedState [2] but exists in object literal [3] in property defaultPersistedState.
116│ paddingTop: 4,
117│ });
118│
[1][2] 119│ export default class extends FlipperPlugin<State, *, PersistedState> {
120│ static keyboardActions = ['clear'];
121│ static subscribed = [];
[3] 122│ static defaultPersistedState = {
123│ requests: {},
124│ responses: {},
125│ routes: [],
126│ showMockResponseDialog: false,
127│ isMockResponseSupported: false,
128│ };
129│
130│ static metricsReducer = (
131│ persistedState: PersistedState,
132│ ): Promise<MetricType> => {
133│ const failures = Object.keys(persistedState.responses).reduce(function(
:
290│ showMockResponseDialog={showMockResponseDialog}
291│ clear={this.clearLogs}
292│ copyRequestCurlCommand={this.copyRequestCurlCommand}
293│ onRowHighlighted={this.onRowHighlighted}
294│ highlightedRows={
295│ this.state.selectedIds ? new Set(this.state.selectedIds) : null
296│ }
297│ handleRoutesChange={this.handleRoutesChange}
298│ isMockResponseSupported={this.state.isMockResponseSupported}
299│ />
300│ <DetailSidebar width={500}>{this.renderSidebar()}</DetailSidebar>
301│ </FlexColumn>
302│ );
303│ }
304│ }
305│
306│ type NetworkTableProps = {
307│ requests: {[id: RequestId]: Request},
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/index.js:189:21
Cannot call this.setState with object literal bound to partialState because:
• Either property isMockResponseSupported is missing in State [1] but exists in object literal [2].
• Or a call signature declaring the expected parameter / return type is missing in object literal [2] but exists in
function type [3].
src/plugins/network/index.js
[1] 119│ export default class extends FlipperPlugin<State, *, PersistedState> {
:
186│ this.informClientMockChange(this.props.persistedState.routes);
187│ }
188│ this.client.supportsMethod('mockResponses').then(result =>
[2] 189│ this.setState({
190│ isMockResponseSupported: result,
191│ }),
192│ );
193│ }
194│
/private/tmp/flow/flowlib_1c80054e/react.js
[3] 35│ partialState: ?$Shape<State> | ((State, Props) => ?$Shape<State>),
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/index.js:226:28
Missing type annotation for routes.
223│ this.props.setPersistedState({responses: {}, requests: {}});
224│ };
225│
226│ informClientMockChange = routes => {
227│ this.client.supportsMethod('mockResponses').then(supported => {
228│ if (supported) {
229│ this.client.call('mockResponses', {
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/plugins/network/index.js:298:47
Cannot get this.state.isMockResponseSupported because:
• property isMockResponseSupported is missing in State [1].
• property isMockResponseSupported is missing in object literal [2].
[1] 119│ export default class extends FlipperPlugin<State, *, PersistedState> {
:
[2] 201│ state = {
202│ selectedIds: this.props.deepLinkPayload ? [this.props.deepLinkPayload] : [],
203│ };
:
295│ this.state.selectedIds ? new Set(this.state.selectedIds) : null
296│ }
297│ handleRoutesChange={this.handleRoutesChange}
298│ isMockResponseSupported={this.state.isMockResponseSupported}
299│ />
300│ <DetailSidebar width={500}>{this.renderSidebar()}</DetailSidebar>
301│ </FlexColumn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment