Error #types/signalr/index.d.ts is no ta module - signalr

I'm trying to use signalr with Typescript. Server side is ASP.NET (not ASP.NET CORE) I installed both signalR (https://www.npmjs.com/package/signalr) and #types/signalr (https://www.npmjs.com/package/#types/signalr).
My import looks like this:
import * as signalR from 'signalr';
The problem is I got an error: "File '... /node_modules/#types/signalr/index.d.ts' is not a module.
Not sure what to do about this. It's only with signalR library I have this problem.

Simply using import 'signalr' worked.

Related

SSR project with VUE 3, express and usevue/head

So I have a project on vue 3, in with was requested to add metadata(og, and twitter), so has been a long week, due I never had to work with something like that before, and it seems there are only 2 options available as I can see, so I have chose to work with usevue/head plugin, however the SSR part was not clear in the documentation, assuming that you already know. So after a long research, testing, and watching tutorials, I found how to, the component rendering to head was the easy part and is done(in my main project not in this repository, because my project I still don't have the ssr part and it's what I'm trying to figure out).
However for the SSR I created a empty project(check repository here) where I just want to run the server together with the plugin example code from the documentation, however now I'm facing 2 issues:
For some reason the css coming from the components is not being "compile" by the server.
More important, when importing the usevue/head plugin into the project I got an error: "UnhandledPromiseRejectionWarning: ReferenceError: useHead is not defined"
I suppose is because now I have 2 "main" js files, one for the server, and one for the client side, so I'm guessing that I need to import somehow the plugin to the main.server one as well, which currently looks like that:
import App from './App.vue'
export default App;
While my client side one looks like:
import { createApp } from 'vue'
import App from './App.vue'
import { createHead } from '#vueuse/head'
const head = createHead();
createApp(App).use(head).mount('#app');
If I am guessing correctly, the question is, how do you include in general a third party plugin in a server side file, not to mention the router?
Thank you in advance for your help. Also if you can recommend something else, also is very welcome.

The method 'installAppCheckProviderFactory' isn't defined for the type 'FirebaseAppCheck'

i am trying to use firebase new feature which is App check for flutter app in android emulator.
i am trying to activate the debug provider for android by following this instructions app check .
for line "firebaseAppCheck.installAppCheckProviderFactory(
DebugAppCheckProviderFactory.getInstance());" , i got error message that says The method 'installAppCheckProviderFactory' isn't defined for the type 'FirebaseAppCheck'
does anyone know how to solve this problem
I have run into the same problem myself.
It's not stated on this page but the imports you need are:
import com.google.firebase.FirebaseApp;
import com.google.firebase.appcheck.FirebaseAppCheck;
import com.google.firebase.appcheck.debug.DebugAppCheckProviderFactory;

Using Bootstrap-Slider in Vue with Typescript

I'm trying to create a boostrap-slider on my page using a vue backend built with TypeScript and ASP net core. I'm using the standard template for Vue.js with TypeScript in ASP.NET Core.
I've imported the boostrap-slider types with
npm install --save #types/bootstrap-slider
and when I try to
import { Slider } from 'bootstrap-slider';
I get the error
ERROR in [at-loader] ./ClientApp/components/mycomponent/mycomponent.ts:3:24
TS2306: File '~~redacted~~/node_modules/#types/bootstrap-slider/index.d.ts' is not a module.
To achieve your goal you can refer to this MSDN post.
This sample demonstration will help you to setup Vue.js with TypeScript in ASP.NET Core.
Complete Description
setup Vue.js with TypeScript in ASP.NET Core.
Sample Source Code:
Vue.js with TypeScript in ASP.NET Core
To achieve Boorstrap-Slider you can use vue-bootstrap-slider
for further details see link: vue-bootstrap-slider
The error occurs because the type definitions don't export a module, so you can't import it. They do this because you can call the slider functions through jquery:
var someSlider = $("input.slider").slider();
var value = someSlider.slider('getValue');
These functions are properly typed because the typings are found even without any imports.

I need help to connect WebSocket SignalR

i have a problem to connect my app.js on my hubs/socket.js
when made my js and put the conecction
var stream = $.connection.sockets;
show my this error
app.js:2 Uncaught TypeError: Cannot read property 'sockets' of undefined
i coppy a example from other proyect and i don't know how does it work
i made the proyect in asp.net mvc in visual studio 2015
What is the order of js references you have made?
Also, have you added reference to the signalr jQuery library and signalr/hubs?

Meteor 1.3 : Can't import plotly.js

I am trying to load plotly.js on the client side in my angular2-meteor app (Meteor 1.3), and I can't figure out how to do so.
I've tried many variations of imports 'plotly.js', import { Plotly } from 'plotly.js' and so on, but none of them seem to work on the client (did not test on server so far).
The file that imports plotly is in the imports folder, so that I can use it either on server or on client.
Compiler gives me "Cannot find module 'plotly.js'" for most of my tries, imports 'plotly.js' gives no error message, but the Plotly object is not defined.
Do you have any solution ? I'd like a real solution more than a quickfix or CDN loading, as this kind of issue seems to appear with a lot of npm packages. Thanks a lot !

Resources