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.

flow types imported from library are all 'any'

See original GitHub issue

Hello

I am trying to import flow types from your library for use in my application. Unfortunately, they appear to be all ‘any’. I have this simple example:

/* @flow */
import type { LocationState, NavigationAction } from 'redux-first-router';

const location: LocationState = {
    foo: 'bar',
    car: 1,
};

Running flow I see No errors! and no complaints from my editor (vscode). If I hover over the types, vscode tells me they are ‘any’.

I have had a dig around in node_modules/redux-first-router/dist and the flow-types.js file is empty. There are type definitions in flow-types.js.flow and index.js.flow.

I am have tried v0.0.16-next and v1.9.19 with no success. I am on flow version 0.52.0.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
petegleesoncommented, Sep 30, 2017

Hey mate, I think I have fixed this problem. The // @flow annotation was missing in index.js. I tested my changes with the repo above and the types are being imported correctly.

1reaction
petegleesoncommented, Sep 20, 2017

Am I importing the types in the right way?

I have put together a simple repo that illustrates the problem. Could you please tell me what behaviour you get?

https://github.com/petegleeson/redux-first-router-flow

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't import module types in Flow library definitions #2023
So just to clarify – Flow itself does allow importing types from different libraries, but flow-typed doesn't currently support it. @villesau ...
Read more >
Module Types | Flow
Importing and exporting types. It is often useful to share types in between modules (files). In Flow, you can export type aliases, interfaces,...
Read more >
Importing in library definition (flow-typed/) doesn't work in flow ...
Importing in library defintion file (flow-typed/lib.js) doesn't seem to work correclty. Directory structure in flow-typed : flow-typed | - lib ...
Read more >
Flow | Checking third-party code
Note that if a 3rd party library is present in your project that isn't itself typed, Flow will treat it just like any...
Read more >
What I wish I had known before starting to use Flow
Unfortunately, the library definition syntaxes differ enough to make them ... In some projects, it might be possible to type all the ...
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