You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
intentionally malformed package.json fixture in tests breaks flowtype when checking node_modules #262
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ node_modules/resolve/test/resolver/malformed_package_json/package.json:2:1 Unexpected end of input, expected the token }
To collect published types. It finds package.json to check for entry point and cannot parse it. Why tests are published anyway? Do they or ci configs have any use in node_modules?
It seems like a bug should be filed on flow so that it doesn't fail when it encounters invalid JSON, especially inside node_modules. Please link to it here when that’s filed.
changed the title [-]Flow type checking error[/-][+]intentionally malformed package.json fixture in tests breaks flowtype when checking node_modules[/+]on Jan 5, 2022
I'd still suggest filing a bug on flow itself, so that by default it doesn't crash on this case.
Closing, since the only issue I know about here is caused by flow, and ignoring the file in flow config works. Happy to reopen if a different scenario is causing problems.
It seems like a bug should be filed on flow so that it doesn't fail when it encounters invalid JSON, especially inside node_modules. Please link to it here when that’s filed.
Activity
ljharb commentedon Jan 4, 2022
Why is flow checking node_modules?
TrySound commentedon Jan 4, 2022
To collect published types. It finds package.json to check for entry point and cannot parse it. Why tests are published anyway? Do they or ci configs have any use in node_modules?
ljharb commentedon Jan 4, 2022
@TrySound Tests are published in all my packages because
npm explore foo && npm install && npm testshould always work.ljharb commentedon Jan 4, 2022
It seems like a bug should be filed on flow so that it doesn't fail when it encounters invalid JSON, especially inside node_modules. Please link to it here when that’s filed.
[-]Flow type checking error[/-][+]intentionally malformed package.json fixture in tests breaks flowtype when checking node_modules[/+]paritosh-yadav commentedon Jan 5, 2022
Hi @ljharb ,
I have ignored the lib in flow config. Previously ignoring lib isn't working, but now it is.
ljharb commentedon Jan 5, 2022
I'd still suggest filing a bug on flow itself, so that by default it doesn't crash on this case.
Closing, since the only issue I know about here is caused by flow, and ignoring the file in flow config works. Happy to reopen if a different scenario is causing problems.
jacksontims123 commentedon Jan 5, 2022
So you can ignore when problems arise in flow?
ljharb commentedon Jan 5, 2022
@jacksontims123 i closed this under the assumption that #262 (comment) means you can indeed ignore that file path, and flow will avoid crashing.
chrisbobbe commentedon Jan 25, 2022
facebook/flow#2364
[Tests] avoid publishing "malformed package.json" test to avoid flawe…