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

Module '"http"' has no exported member 'ServerRequest'. #124

Closed
rp3e11 opened this issue Mar 30, 2020 · 9 comments · Fixed by #131
Closed

Module '"http"' has no exported member 'ServerRequest'. #124

rp3e11 opened this issue Mar 30, 2020 · 9 comments · Fixed by #131
Assignees

Comments

@rp3e11
Copy link

rp3e11 commented Mar 30, 2020

Hi,
I get the following issue when trying to serve an angular application after importing BuilderModule in angular. It happens when using it in existing Angular 8 and also in a fresh Angular 9 app.

ERROR in node_modules/@builder.io/sdk/dist/src/builder.class.d.ts:2:10 - error TS2305: Module '"http"' has no exported member 'ServerRequest'.
I had a look around and found one issue on a different project that seems to be similar

@steve8708
Copy link
Contributor

Thanks for the heads up @rp3e11 - we'll take a look at updating this to work as expected

In the meantime, updating your tsconfig.json to have "skipLibCheck": true in "compilerOptions" should circumvent this error until the fix is in!

@rp3e11
Copy link
Author

rp3e11 commented Mar 31, 2020

Ok, thanks, do you have any idea how long it will take to fix it?

@steve8708
Copy link
Contributor

@rp3e11 we happily accept PRs if you would like to send a pull request with the fix in it we will merge and push a dev version with your fix in it quickly

@rp3e11
Copy link
Author

rp3e11 commented Mar 31, 2020

Is there anywhere some documentation on contributing and setting up a dev environment?

@ca136
Copy link
Contributor

ca136 commented Mar 31, 2020

@rp3e11 is it an option for you to set skipLibCheck: false in your tsconfig.json file?

This is a TypeScript issue that likely started after we added support for an Angular 8 release. The ideal fix for the TS errors that sometimes show up would be to upgrade to a new version of TS, but that could cause issues for people using older versions.

Ideally we'd add a fix for this to a future major release of the angular sdk.

@rp3e11
Copy link
Author

rp3e11 commented Apr 1, 2020

@ca136 I added the skipLibCheck flag to my dev environment to see whether it works and I could do some testing with builder to understand the potential. However, for the production environment I don't think it is a good idea, because it does not only disable the check for your package but also all others that we use. I think I will wait anyway for your next release since I am waiting for https://forum.builder.io/t/angular-integration/31/5.

In terms of the error, I think as well that it is a typescript error, but to my understanding the error means that the type ServerRequest is not defined in the http module of nodejs and looking at the API docs it is not. From the issue linked earlier it seems that it should be replaced by IncomingMessage in builder.class.ts and it should work, so the fix should be fast.

However, in order to test that it doesn't affect any other parts of your code, I was wondering whether you had test in place or how your dev system is built up, so I could test it before providing a pull request.

@rp3e11
Copy link
Author

rp3e11 commented Apr 1, 2020

It seems to be deprecated in node 9 that is used in your package.json type definitions. It probably dropped out in the meantime.

    /**
     * @deprecated Use IncomingMessage
     */
    export class ServerRequest extends IncomingMessage {
        connection: net.Socket;
    }

@ca136
Copy link
Contributor

ca136 commented Apr 1, 2020

Oh good find @rp3e11 ! I had a bunch of other issues in our angular example repo due to being on an older version of Angular (8) and TypeScrip (3.5). It looks like Angular fixed the cli so Angular 9 will work with our existing code. I'll let you know when we publish a new version of the sdk that you can test!

@ca136
Copy link
Contributor

ca136 commented Apr 1, 2020

@rp3e11 this should be fixed in the latest @builder.io/angular: "1.1.4-0"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants