Example:
c.js
export function someFunc(){}
a.js
export * from 'c.js'
b.js
// flow says someFunc is not exported from a
import { somFunc } from 'a'
Did you tried this?
c.js
export function someFunc(){}
a.js
export * from './c.js'
b.js
// flow says someFunc is not exported from a
import { somFunc } from './a'
@TrySound to be more specific I am using yarn workspaces to include different packages across apps. This recently became an issue. I didn't used to see this error
packages/moduleA/someFile.js
export function someFunction() {}
packages/moduleA/index.js
export * from './someFile';
packages/moduleB/index.js
// Cannot import someFunction because there is no someFunction export in moduleA
import { someFunction } from 'moduleA'
I think that @TrySound was trying to say is to use the keyword function between your export and the name of your function
@GhostxRipper - sorry that was a syntax error while typing my example of the issue.
I'm getting this same error whenever using the export * from './file.js' syntax
@chrissantos1995 you need to make sure every file has the // @flow comment at the top
I lost some time today because of this. I was upgrading react-scripts regularly but I have forgotten about flow-bin. Make sure to update it to more recent version (not sure which one introduced support for this syntax).
Most helpful comment
@chrissantos1995 you need to make sure every file has the
// @flowcomment at the top