Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Angular 7 can't build with package @aspnet/signalr@next (1.1.0 preview3-35497) #3254

Closed
plaramee1 opened this issue Nov 4, 2018 · 9 comments
Assignees
Labels
status: Investigate Investigation item
Milestone

Comments

@plaramee1
Copy link

the cli can't resolve the http and https module.

ERROR in ./node_modules/@aspnet/signalr/dist/esm/NodeHttpClient.js
Module not found: Error: Can't resolve 'http' in '/Users/patrick/Workspaces/temp/NGSignalr/signalR/node_modules/@aspnet/signalr/dist/esm'
ERROR in ./node_modules/@aspnet/signalr/node_modules/eventsource/lib/eventsource.js
Module not found: Error: Can't resolve 'http' in '/Users/patrick/Workspaces/temp/NGSignalr/signalR/node_modules/@aspnet/signalr/node_modules/eventsource/lib'
ERROR in ./node_modules/@aspnet/signalr/node_modules/eventsource/lib/eventsource.js
Module not found: Error: Can't resolve 'https' in '/Users/patrick/Workspaces/temp/NGSignalr/signalR/node_modules/@aspnet/signalr/node_modules/eventsource/lib'

@analogrelay
Copy link
Contributor

@BrennanConroy Could be a WebPack thing. Angular shouldn't be using the NodeHttpClient at all...

@BrennanConroy
Copy link
Member

When importing the SignalR library use:

import * as signalR from '@aspnet/signalr/dist/browser/signalr.js';

@anurse We should talk and see if we can make it so Angular loads that file by default.

@analogrelay
Copy link
Contributor

@BrennanConroy it shouldn't have to, but we may need to change our config to make it work. Angular is using WebPack, which uses the Module version.

@rcanpahali
Copy link

Any solution for this issue? I'm also facing with this problem...

NodeInvocationException: Prerendering failed because of error: Error: Cannot find module './NodeHttpClient' at Function.Module._resolveFilename (module.js:536:15) at Function.Module._load (module.js:466:25) at Module.require (module.js:579:17) at require (internal/module.js:11:18) at eval (webpack-internal:///./node_modules/@aspnet/signalr/dist/esm/DefaultHttpClient.js:26:28) at Module../node_modules/@aspnet/signalr/dist/esm/DefaultHttpClient.js (C:\Users\can.pahali\source\WestCore.MvcSpa-Dev\ClientApp\dist\main-server.js:1923:1) at __webpack_require__ (C:\Users\can.pahali\source\WestCore.MvcSpa-Dev\ClientApp\dist\main-server.js:26:30) at eval (webpack-internal:///./node_modules/@aspnet/signalr/dist/esm/index.js:15:76) at Module../node_modules/@aspnet/signalr/dist/esm/index.js (C:\Users\can.pahali\source\WestCore.MvcSpa-Dev\ClientApp\dist\main-server.js:2139:1) at __webpack_require__ (C:\Users\can.pahali\source\WestCore.MvcSpa-Dev\ClientApp\dist\main-server.js:26:30) Current directory is: C:\Users\can.pahali\source\WestCore.MvcSpa-Dev

@BrennanConroy
Copy link
Member

Have you tried using the 1.1.0 package?

@tomagb
Copy link

tomagb commented Dec 11, 2018

Yes, I've tried with 1.1.0 package and the issue didn't go away.

@BrennanConroy
Copy link
Member

Could you provide a sample app? I can't reproduce the issue.

@tomagb
Copy link

tomagb commented Dec 11, 2018

Does this SO help?
I might need some time to strip the (NDA) app in order to post it.

@BrennanConroy
Copy link
Member

Nope, that's the same app I have...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: Investigate Investigation item
Projects
None yet
Development

No branches or pull requests

6 participants