Code Monkey home page Code Monkey logo

Comments (6)

dxshindeo avatar dxshindeo commented on August 21, 2024

Having the same error. import SocketIO = require("nativescript-socket.io");
However, this worked: var SocketIO = require('nativescript-socket.io');

But now I'm getting error "io is not defined".
I presume I don't have those dependencies? How do I get them/install them?
Android: Socket.IO-client Java v0.8.* iOS: Socket.IO-Client-Swift v8.1.*

I see that in include.gradle file you specify it as a dependency:
dependencies { compile ('io.socket:socket.io-client:0.8.+') { exclude group: 'org.json', module: 'json' } }
Upon further research (https://docs.nativescript.org/plugins/plugins#includegradle-specification):
Any native dependencies should be available in jcenter or from the Android SDK installed on your machine.

I doubt this library is locally on Android SDK, so probably we are getting it from here: https://bintray.com/bintray/jcenter/io.socket%3Asocket.io-client

In socket.d.ts file, I see 2 errors:
First - public android: io.socket.client.Socket; - here is where the io cannot be found.
Second - import * as helpers from "./helpers"; - says "Import or Export declaration is an ambient module declaration cannot reference module through relative module name"

from nativescript-socket.io.

naderio avatar naderio commented on August 21, 2024

checking this issue...
native dependencies are added when plugin is installed.
otherwise I have this working on in a JavaScript-based app on both iOS and Android. I probabaly need to check with TypeScript.

from nativescript-socket.io.

naderio avatar naderio commented on August 21, 2024

reopened

from nativescript-socket.io.

naderio avatar naderio commented on August 21, 2024

please check v0.2.3 .. should be fine

from nativescript-socket.io.

dxshindeo avatar dxshindeo commented on August 21, 2024

Thank you, it works now :)

from nativescript-socket.io.

sowrabhbs avatar sowrabhbs commented on August 21, 2024

its working,Thanks @naderio

from nativescript-socket.io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.