Closed baptistapedro closed 4 years ago
Did you double check that it is in the package.json file as a dependancy. And that it is in the node_modules folder?
Yes, it is present on both.
Do I have to downgrade the version of something on my project?
Because if I remove the declare var require: any;
I have this issue:
ERROR in ./src/app/home/home.component.ts
Module not found: Error: Can't resolve 'nativescript-websockets' in 'C:\Users\gitim\Documents\cliApp\src\app\home'
i 「wdm」: Failed to compile.
ERROR in src/app/home/home.component.ts(4,1): error TS2591: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i @types/node` and then add `node` to the types field in your tsconfig.
Even with the installation of @types/node and also add the node on my tsconfig
This is my version: @types/node@8.10.54
My project was created using this command
ng new --collection=@nativescript/schematics --name=my-app --shared
I believe if you do the same and try to use the websockets plugin, you'll run through the same issue.
Seems like your plugin does not work on web, only Android and iOS
Correct, this plugins is only for Android / iOS. Web already has a built in websocket; so you don't need my library for it. :grinning:
You can use pusher-nativescript npm module.
import { Pusher } from 'pusher-nativescript'; /*Observation using the above.
@thepraveenkumar - I'm not sure if you are trying to report a bug; or suggest he uses pusher... If it is a bug, then you need to report this issue on whatever repo is for pusher-nativescript
.
I'm not sure why it cant resolve the plugin, I have it installed properly of course.
https://dpaste.de/4C8f