-
Notifications
You must be signed in to change notification settings - Fork 4
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
Importing @streamparser/json
results in error when using tsc
or jest
relying on tsc
#516
Comments
Created an upstream issue at juanjoDiaz/streamparser-json#25. |
This works fine in a prototyping script: import { JSONParser } from '@streamparser/json';
async function main() {
console.log(JSONParser);
}
main(); It's only the IDE that complains. Running
|
Are you getting that error when running JEST tests? If not, then ignore the IDE, and just proceed. It's just an IDE configuration issue. |
I see... it fails in jest, but works in |
Note that our |
I think this is related to: MatrixAI/TypeScript-Demo-Lib#32. The package appears to be module type. But it must be breaking on resolution somehow. |
Here you can see the issue:
But if I use swc it ends up keeping it as regular imports. I think this is because our |
streamParser
import error@streamparser/json
results in error when using tsc
or jest
relying on tsc
This should be done with the merge of #513. |
Specification
As part of #249 we're using a JSON stream parser to parse the JSONRPC messages. There seems to be a problem with this library specifically where we can't import it with the
import
keyword. So far a work around has been to import it withconst jsonStreamParsers = require('@streamparser/json');
.We need to import it with
import { JSONParser } from '@streamparser/json';
. but currently doing so results in aTS2307: Cannot find module '@streamparser/json' or its corresponding type declarations.
error.So far I haven't been able to determine why the usual import isn't working. From what I can tell it's using conditional exports within it's
package.json
file for specifying the exports. This may be related?Additional context
Tasks
import
keyword.The text was updated successfully, but these errors were encountered: