I am currently working on integrating a SignalR client into an Angular application using Webpack and TypeScript.
Here is the content of my package.json file:
{
"private": true,
"version": "0.0.0",
"scripts": {
"test": "karma start ClientApp/test/karma.conf.js"
},
"devDependencies" { ... }
"dependencies": {
"@aspnet/signalr": "^1.1.0"
}
}
The TypeScript code for this integration looks like this:
import { HubConnectionBuilder } from '@aspnet/signalr';
@Component({
selector: 'stream-details',
templateUrl: './stream-details.component.html'
})
export class StreamDetailsComponent implements OnInit {
@Input() summary: any;
constructor(private deviceService: StreamService) {
}
ngOnInit() {
let connection = new HubConnectionBuilder()
.withUrl('/streamingHub')
.build()
connection
.start()
.then(() => connection.stream('SubscribeToStream', 'stream123'));
}
}
Upon running the application, I encounter the following error:
NodeInvocationException: Prerendering failed because of error: Error: Cannot find module './NodeHttpClient'
I am confused as to why the NodeHttpClient.js file is not being included. Can anyone provide assistance on what might be missing?