I'm trying to get the cytoscape-qtip package working with meteor though npm.
I've installed cytoscape, jquery, qtip2 and cytoscape-qtip through with the "meteor npm install --save" command, and I'm importing and registerng them in my template as follows:
import cytoscape from 'cytoscape'
import jquery from 'jquery'
import cyqtip from 'cytoscape-qtip';
import qtip from 'qtip2';
cyqtip(cytoscape, jquery);
When I try to use the .qtip command on a cytoscape element, I get the following error:
TypeError: qtip.$domEle.qtip is not a function
I've tried usinng atmosphere packages (cytoscape:cytoscape, maxkfranz:cytoscape and maxkfranz:cytoscape-qtip) instead, but I end up getting the same error.
If I try to import the jquery bundled with meteor instead (import jquery from 'meteor/jquery'), my page will not load at all, and I get the error "TypeError: $ is not a function".
The documentation for cytoscape-qtip states
Note that jquery must point to a jQuery object with .qtip() registered if any sort of require() is used.
Could this be the problem, that qtip is somehow not registered with the jQuery object? If so, how do I register it?
I can see that this guy had a similar problem, solved by changing the import order of his scripts, but since I'm using npm I'm not sure how I can manually change the import order.
Any help would be greatly appreciated!
If there's a jQuery object on window, then qTip registers itself: https://github.com/qTip2/qTip2/blob/v3.0.2/src/core/intro.js. You may just have to set that manually for qTip to register itself.
Related
If you run
npx degit vercel/turbo/examples/with-react-native-web with-react-native-web
cd with-react-native-web
yarn install
To create a basic Turborepo that has a Nextjs application, a react-native mobile app with Expo and a ui package to share components between apps (there is a Button as an example already shared between the two apps), it works. But my ui package needs other dependencies, for example:
#fortawesome/fontawesome-svg-core,
#fortawesome/free-solid-svg-icons,
#fortawesome/react-native-fontawesome,
This is because the buttons that I want to render icons on my buttons. Once I install this dependency and try to use the button that has an icon, the Next.js app throws:
Unexpected token 'export'.
I understand this is because #fortawesome/react-native-fontawesome is using import/export syntax and needs to be transpiled to be used on the Next.js app, and I cannot make it work. I am trying to do this by adding this to my next.config.js:
transpilePackages: ['ui'],
I also tried using next-transpile-modules which i don't think is the right solution since next now supports what that package used to be for through transpilePackages
I also tried to specify that the ui package was "type": "module" but still, I am getting the same error.
How can you specify that those dependencies that belong to the ui package must be transpiled to be run by the browser?
I have checked the package #fortawesome/react-native-fontawesome
package.json of #fortawesome/react-native-fontawesome does not contain field "type": "module" but index.js contains:
export { default as FontAwesomeIcon } from './dist/components/FontAwesomeIcon'
therefore Next handles #fortawesome/react-native-fontawesome as non-ES module but this module contains export statement.
You mentioned transpilePackages field in next.config.js, so I think it may help with this issue (but pls check version of Next where transpilePackages appeared).
I am building a student project. I have tried several times to incorporate Material UI into my project but have had no success. For instance, I am attempting to add "App Bar with Menu" linked here. I have installed npm install #mui/material #emotion/react #emotion/styled #material-ui/icons in React, and copied the code exactly from MUI's example into its own component in my project, but am receiving the following errors:
Compiled with problems:
ERROR in ./src/components/MenuAppBar/MenuAppBar.js 12:0-48
Module not found: Error: Can't resolve '#mui/icons-material/Menu' in '/home/michael/flatiron/phase-5/project-template/frontend/src/components/MenuAppBar'
ERROR in ./src/components/MenuAppBar/MenuAppBar.js 13:0-62
Module not found: Error: Can't resolve '#mui/icons-material/AccountCircle' in '/home/michael/flatiron/phase-5/project-template/frontend/src/components/MenuAppBar'
What am I missing? I don't see any documentation on this AppBar that would tell me I have to install something other than what I've installed, and I pulled up three youtube videos which simply show the user copying the code into a component, as I've done.
IntelliJ IDEA started highlighting errors in some of my import statements that worked previously. This is not unexpected as net.corda.finance is still in the "incubating" stage.
I am working in Java.
Corda Release: 3.3
Noticed this change on github: https://github.com/corda/corda/pull/4700
So I made what I thought are the necessary changes...
//Old
//import static net.corda.finance.utils.StateSumming.sumCashBy;
//New
import static net.corda.finance.contracts.utils.StateSumming.sumCashBy;
...but I'm still getting an error. I am sure I must be overlooking something simple.
#Kid101 put me on the right track by trying StateSumming.sumCashBy(contractState)
Once I did that IntelliJ recognized I needed to add:
net.corda:corda-finance:3.3-corda
...to the classpath. If I allowed IntelliJ to add it from the context menu the error reappeared every time gradle refreshed. So I added:
cordaCompile "$corda_release_group:corda-finance:$corda_release_version"
...to the build.gradle file under the dependencies section. No more errors with my import statement:
import net.corda.finance.utils.StateSumming;
...and no issues calling the sumCashBy method.
The change you mention is in Corda master branch, In CashTests.kt you can see how sumCashBy is imported, import net.corda.finance.contracts.utils.sumCashBy.
In corda/release-V4-branchpoint import is still net.corda.finance.utils.sumCashBy i.e. the change has not made in yet to V4.
Try to build the project again.
If using Java, try: StateSumming.sumCashBy(contractState)
You should import a dependency package.
You add below to build.gradle and refresh your IntelliJ project.
dependencies {
....
cordaCompile "$corda_core_release_group:corda-finance-contracts:$corda_core_release_version"
...
I downloaded the harrison:papa-parse package : meteor add harrison:papa-parse.
But now i need to load it in my Meteor application so i can use it.
I imported the package in my Component :
import { Papa } from 'meteor/harrison:papa-parse';
and then i need to declare the module in typing.d.ts file
declare module 'meteor/harrison:papa-parse' {
// something here like export const Papa; ?
}
, but after that i'm lost ! and i have an error: cannot read property 'parse' of undefined
In My component :
Papa.parse("http://mywebsite/test.csv", {
download: true,
complete: function(results) {
console.log(results);
}
});
Maybe there's an easy way to import the package easly and i'm trying to complicate it ?
The meteor package exports the "Papa" variable on the server, which means you have to call it from a server process.
Delete this line from your code, because it won't do anything:
import { Papa } from 'meteor/harrison:papa-parse';
Meteor packages don't need to be imported, part of the package spec is an automatic import of whatever variables are needed.
According to the documentation this package should be available in the browser, but for some reason the meteor package author made the decision to only expose it in the server.
There is also an npm package available, which might be a better path for you to follow.
You don't need the harrison:papa-parse meteor package. You can install and use the papaparse NPM package directly. In the root of your meteor project run meteor npm install --save papaparse. Then, in your client script you can import with import Papa from 'papaparse';.
I am getting cannot resolve FirebaseRecyclerAdapter when trying to use it even after adding firebase ui in gradle dependency.Thanks in advance
I was getting the same issue, it's resolved by adding the firebase-ui dependency in build.gradle (module:app)
compile 'com.firebaseui:firebase-ui-database:0.4.0'
Also add the import in .java file where you're trying to declare it.
import com.firebase.ui.database.FirebaseRecyclerAdapter;
Go to build.gradle file, add a dependency (get the latest one from here https://github.com/firebase/FirebaseUI-Android)
The latest one on 5 October 2019 is implementation 'com.firebaseui:firebase-ui-database:6.0.2'
If You are facing Problem in 2020 then use this dependency:
implementation 'com.firebaseui:firebase-ui-database:6.0.2'
above mentioned answers are not working in today's date i have tried all of them,remember import this package too:
import com.firebase.ui.database.FirebaseRecyclerAdapter;
Can you show your build.gradle file?
Also, have you tried putting this under your package name in your java class: import com.firebase.ui.database.FirebaseRecyclerAdapter;?
In your app level gradle:add the following firebase dependency
dependencies {
compile'com.firebaseui:firebase-ui-database:1.1.1'
The dependencies quoted above don't seem to work anymore. After about an hour of searching online, I found this; hopefully it helps someone. It certainly fixed my problem:
compile 'com.firebaseui:firebase-ui:0.4.3'
Use exactly the matched version of FireBaseRecyclerAdapter
to the Versions that you have included in gradle for the Firebase Database.
This link will surely help you
https://github.com/firebase/FirebaseUI-Android
In this link, you will find the matched Firebase dependency according to the version.
I tried to import the following three packages, and my problem is solved:
implementation "androidx.recyclerview:recyclerview:1.2.1"
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation 'com.firebaseui:firebase-ui-database:8.0.1'
implementation 'com.firebaseui:firebase-ui-database:1.2.0'
You can use this gradle dependencies