-
Notifications
You must be signed in to change notification settings - Fork 308
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
fixed missing import from graphql-ws.ts #453
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you share what the error was? WebSocket
is a global in the DOM. It sounds like your backend code pulled in some frontend code? A broken test would help.
This PR is related to #385 and you can see error from there: #330 (comment) |
It is because we are not in the DOM, we are in the backend (iow node environment) so while building via |
Yes exactly right, code doesn't compiles with |
If needed, I think we can add test by adding mock tsconfig with node environment and simply running |
These kinds of project configuration issues are easy to regress on. A solution would be to have a test that scaffolds a project, installs the package, via yalc perhaps, and tries to do a build of the test project. This is a heavy test but the reality of covering stuff like this. I'll get around to writing a test for this myself but one is welcome. I've written a lot of tests like this before so have a pretty opinionated way I'll go about it, using |
You can check error from reproducer repository: https://github.com/EmirBoyaci/graphql-request-tsc-error You just need to clone, run |
@EmirBoyaci because the test might take some time to actually implement, there might be some value breaking apart the fix from the test. Can you just drop a TODO about it and then get the tests passing? That should be enough for this PR! As for right now you can skip lib check right? |
Owner of this PR is @nizamani , I think he should make that :) Yes, as a workaround I can do that but we are using shared tsconfig in our company, so fixing this issue would be really great in short tearm (if possible :D) |
Yeah I understand a library being the cause of |
@jasonkuhrt those changes are made,
|
Then can we make the type reflect that? We shouldn't have to resort to |
I tried making |
Any movement on this PR? this issue still happens |
@nizamani are you still interested in landing this? Could you rebase your PR and get it back into a mergable state? |
Closing this due to a lack of response from the author of the PR. If anyone is interested in landing this please open up a new PR. |
file graphql-ws.ts had missing import
WebSocket
which is being imported fromws
dependency. This causes project to not build/compile in nestjs