I did npm install socket.io-client.
I then import it as shown below
import React from 'react-native';
import './UserAgent';
import io from 'socket.io-client/socket.io';
But when I run my app, I get the following error:
Requiring uknown module "socket.io-client/socket.io". If you are sure
this module is there, try restarting the packager.
I tried installing again and updating from npm.
I restarted the packager like 1000 times.
Any ideas as to why this is happening?
Same issue and I found solution.
Change code from
import io from 'socket.io-client/socket.io';
to
import io from 'socket.io-client/dist/socket.io';
Try add dist directory.
I had same issue a couple of days ago and resolved it below reference.
reference:
https://github.com/reactotron/reactotron/pull/280/commits/d8725351e80093edc4bcfb65d6389a9ba654ff37
The module is socket.io-client so,
import io from 'socket.io-client'
For everyone stuck on this, I managed to fix it by including the socket.io.js standalone file in my project and importing it from there.
For some reason the RN Packager does not build the dependency in node_modules.
I'm using the same code as you with no trouble. Perhaps you need to upgrade your react-native? I'm on the latest as of this writing: 0.18.0-rc.
window.navigator.userAgent = 'react-native';
let io = require('../../node_modules/socket.io-client/dist/socket.io');
Tried everything I could think of this is the only thing that worked for me.
I think you'll find that you will have issues importing SocketIO in this fashion, via import.
You can try switching to the require syntax and be sure to include the requisite userAgent line beforehand.
window.navigator.userAgent = 'react-native';
let io = require('socket.io-client/socket.io');
I have a project which does the same thing which you can compare against, React Native Messenger.
Verify that socket io client is installed in node_modules dependency, if not try to reinstall the dependency. If it is there then you can update the statement
import io from 'socket.io-client/socket.io'
to
import io from 'socket.io-client/dist/socket.io.js'
It should work now.
Related
When I import androidx.activity.result.ActivityResult; my IDE says: can not resolve symbol 'result' as bellow:
.
In different similar situations, e.g., cannot access androidx activity result activityresultcaller and package androidx activity result does not exist, I see that the problem is solved by upgrading androidx.activity, androidx.appcompat, and androidx.fragment in the dependency part of the build.gradle.
I tried to upgrade different combination of the above packages in the module build.gradle, but non of them solved the problem.
Does anyone know how I can solve it? Thanks.
I'm using updated sphinx v4.5 on Anaconda, faced while running command make html with Admin rights on Anaconda Console issue can be found at issue_tracker here. On issue tracker, it looks like this was resolved in v4.1, but I think it's not resolved and still exists or may be I didn't understood the solution exactly.
Running Sphinx v4.5 Could not import extension sphinx.builders.epub3 (exception: cannot import name 'RemovedInSphinx40Warning' from 'sphinx.deprecation'.
Tried uninstalling and installing Sphinx again, but no results.
Any leads would be helpful.
If it is resolved, please elaborate the exact steps needs to followed to recover this issue.
Thanks in Advance.
Im running a job using the mlxtend library. Specifically the sequential_feature_selector that is parallelized using joblib.Parallel source. When I run the package on my local computer it uses all the available CPUs, but when i send the job to cloud-ml it only uses one core. It doesn't matter what is the number that i put in the n_jobs parameter. I´ve also tried with differents machine types but same thing happen.
Does anybody know what the problem might be ?
For anyone that might be interested, we solve the problem fixing the sklearn version in the setup.py to the 0.20.2. we had sklearn in the packages before, but without a version.
#setup.py
from setuptools import find_packages
from setuptools import setup
REQUIRED_PACKAGES = ['joblib==0.13.0',
'scikit-learn==0.20.2',
'mlxtend']
New Go programmer here -- apologies if this is well worn territory, but my google searching hasn't turned up the answer I'm looking for.
Short Version: Can I, as a programmer external to the core Go project, force my packages to be imported with a specific name. If so, how?
Long Version: I recently tried to install the bcrypt package from the following GitHub repository, with the following go get
go get github.com/golang/crypto
The package downloaded correctly into my workspace, but when I tried to import it, I got the following error
$ go run main.go main.go:10:2: code in directory /path/to/go/src/github.com/golang/crypto/bcrypt expects import "golang.org/x/crypto/bcrypt"
i.e. something told Go this package was supposed to be imported with golang.org/x/crypto/bcrypt. This tipped me off that what I actually wanted was
go get golang.org/x/crypto/bcrypt
I'd like to do something similar in my own packages — is this functionality built into Go packaging? Or are the authors of crypto/bcrypt doing something at runtime to detect and reject invalid package import names?
Yes it's built in, I can't seem to find the implementation document (it's a relatively new feature in 1.5 or 1.6) however the syntax is:
package name // import "your-custom-path"
Example: https://github.com/golang/crypto/blob/master/bcrypt/bcrypt.go#L7
// edit
The design document for this feature is https://docs.google.com/document/d/1jVFkZTcYbNLaTxXD9OcGfn7vYv5hWtPx9--lTx1gPMs/edit
// edit
#JimB pointed out to https://golang.org/cmd/go/#hdr-Import_path_checking, and in the go1.4 release notes: https://golang.org/doc/go1.4#canonicalimports
I am following this tutorial:
http://www.raywenderlich.com/25205/beginning-unity-3d-for-ios-part-13
In the middle of it, there is
Assets\Import Package\Scripts\SmoothFollow.js
part.
but I guess that menu is gone for Unity 5?
Where did SmoothFollow.js go ??
You have to install the Standard Assets to get the standard import packages.
See here: http://answers.unity3d.com/questions/917023/unity-5-standard-assets-are-missing.html