I am trying to import SignalR in my Vue.JS application. I use webpack to bundle modules.
In my package.json:
"dependencies": {
"@aspnet/signalr": "^1.1.0"
}
In my component within script section:
<script>
import signalR from '@aspnet/signalr';**
...
</script>
I can see signalR references in main.js (generated by webpack), but when I try to access it the mounted lifehook, I get the error in console:
"export 'default' (imported as 'signalR') was not found in '@aspnet/signalr'
How to import SignalR in a Vue component correctly?
Try to import it this way:
const signalR = require('@aspnet/signalr');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With