Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exporting a default anonymous function crashes #198

Open
karmeleon opened this issue Jun 16, 2023 · 0 comments
Open

exporting a default anonymous function crashes #198

karmeleon opened this issue Jun 16, 2023 · 0 comments

Comments

@karmeleon
Copy link

Input file:

export default function (): void;

Resulting error:

project-dir/node_modules/flowgen/node_modules/typescript/lib/typescript.js:156313
            this.assertHasRealPosition();
                 ^

TypeError: this.assertHasRealPosition is not a function
    at Array.NodeObject.getStart (project-dir/node_modules/flowgen/node_modules/typescript/lib/typescript.js:156313:18)
    at Object.error (project-dir/node_modules/flowgen/lib/logger.js:42:82)
    at parseNameFromNode (project-dir/node_modules/flowgen/lib/parse/ast.js:62:14)
    at collectNode (project-dir/node_modules/flowgen/lib/parse/index.js:51:74)
    at project-dir/node_modules/flowgen/lib/parse/index.js:108:34
    at Array.forEach (<anonymous>)
    at traverseNode (project-dir/node_modules/flowgen/lib/parse/index.js:108:21)
    at recursiveWalkTree (project-dir/node_modules/flowgen/lib/parse/index.js:219:3)
    at project-dir/node_modules/flowgen/lib/cli/compiler.js:35:49
    at project-dir/node_modules/flowgen/lib/env.js:17:14

Adding a name to the function like this causes flowgen to work as expected:

export default function someFn(): void;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants