I am using force-graph in Vue. force-graph has been installed using npm and ForceGraph is imported into a single-file vue component. When I use for a ForceGraph Graph
Graph.d3Force("link",d3.forceLink())
I get an error that d3 is undefined. I have tried to install d3 and to import d3 from it without success.
I am aware of vue-force-graph, but that is reported to have high vulnerability and using it gives errors on multiple imports of threejs.
The errors vanished when I defined d3 as
var d3 = require("d3")
Related
I am getting this error "cannot find symbol import com.google.ads.mediation.facebook.FacebookAdapter" while trying to execute app in android studioenter code here
The problem is cause by 'com.google.ads.mediation:facebook:6.12.0.0'.
Google removed 2 classes: FacebookAdapter and FacebookExtras on version 6.12.0.0.
I don't know why they are remove them (maybe replace for a new API or maybe just a mistake). You can temporary resolve this by downgrade the package version to 6.11.0.0.
I have an npm library which imports Angular FullCalendar v5 and everything works fine there. When i try to import my project library to another project and try access the full calendar frontend I got a warning and a message error in my browser console:
- Warning: main.js:7358 Unknown option 'default'
- Error: core.mjs:6476 ERROR TypeError: Language ID should be string or object.
at new DateTimeFormat (<anonymous>)
at buildNativeFormattingFunc (main.js:1218)
at NativeFormatter.buildFormattingFunc (main.js:1211)
at NativeFormatter.buildFormattingFunc (main.js:1009)
at NativeFormatter.format (main.js:1154)
at NativeFormatter.formatRange (main.js:1169)
at DateEnv.formatRange (main.js:3984)
at CalendarDataManager.buildTitle (main.js:6909)
at CalendarDataManager.buildTitle (main.js:1009)
at CalendarDataManager.updateData (main.js:7113)
I can't figure it out why but i know it's in this line of code at main.js (#fullcalendar/common/main.js)
Line 1218 -> var normalFormat = new Intl.DateTimeFormat(context.locale.codes, standardDateProps); The error is that the variable context.locale.codes is undefined.
Can anyone help?
I've just had the same error. Not that I was importing a project library of my own but I was importing the Fullcalendar library (from node_modules). I had enabled localization using the locale property of the calendar options but I always got this error Language ID should be string or object.
Two things was wrong:
I was importing the locale code incorrectly which resulted in this error. The current version of Fullcalendar (6.0.0) has all its locale code under #fullcalendar/core/locales.
I was using dynamic import like this: import("#fullcalendar/core/locales/da") and it worked fine but I had to access the default property of the exported object. Using async/await syntax it becomes:
const localeModule = await import("#fullcalendar/core/locales/da");
const calendar = new Calendar(someElement, {
(...),
locale: localeModule.default
});
Not directly answering your question but it sounds like you're using locale, too, and your other project is importing your project library in a way that makes the default property of the module containing the locale code undefined.
I am trying to create a new app in vue.js. Basically just wanting the same output from cybersource microform node.
https://github.com/CyberSource/cybersource-flex-samples-node
In my vue project main.js
import cybersourceRestApi from '../node_modules/cybersource-rest-client';
var instance = new cybersourceRestApi.KeyGenerationApi(configObj);
I am encountering an error with its dependencies. There's a lot missing but here's first 3 examples
ApiClient in ./node_modules/cybersource-rest-client/src/index.js
api/CaptureApi in ./node_modules/cybersource-rest-client/src/index.js
api/ConversionDetailsApi in ./node_modules/cybersource-rest-client/src/index.js
Error
RN version: 0.50
Testing on Android, haven't tested on iOS
I am trying to use ErrorUtils.setGlobalHandler as described in this github issue: https://github.com/facebook/react-native/issues/1194
However, what is not clear from the issue is how to import ErrorUtils. It's not in the react documentation: https://facebook.github.io/react-native/docs/0.50/getting-started.html
Previously, in RN 0.41, I was able to import ErrorUtils with import ErrorUtils from "ErrorUtils"; However, in 0.50 I am getting a red react popup with the following message when I try to import ErrorUtils like this:
com.facebook.react.common.JavascriptException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http://localhost:8081/index.bundle?platform=android&dev=true&minify=false' failed to load.
I've also tried import { ErrorUtils } from 'react-native'; but it doesn't seem to exist there. The error is:
Cannot read property 'setGlobalHandler' of undefined
How do I properly import ErrorUtils in RN 0.50?
ErrorUtils is a global variable, therfore it doesn't need to be imported. You can verify this with console.log(global.ErrorUtils)
However it is exported as module anyways (here). The comment there also has more information why it is done this way.
You can import the module like this:
import ErrorUtils from 'ErrorUtils';
For anyone on RN61+, you should no longer import the module as you will experience the following error in the running metro bundler:
Error: Unable to resolve module `ErrorUtils`
Instead, just use the module without importing as this is a global variable, as stated by leo
I did created a global.d.ts to define a global variable,
interface Global {
ErrorUtils: {
setGlobalHandler: any
reportFatalError: any
getGlobalHandler: any
}
}
declare var global: Global
then, at where you are trying to use it, simply
global.ErrorUtils.setGlobalHandler(xxxx)
I updated from angular 4.4.6 and material beta 19 to angular 5 and material 5.0.0-rc0
The application compiles correctly, but executing on Chrome I get
"Uncaught Error: Unexpected value 'MatTable DataSource' imported by the module 'Material Modules'. Please add a #NgModule annotation."
Other material components work correctly, mat-icon, mat-card-content, mat-tab-group, mat-dialog-xxx ...
Could you help me?
MatTableDataSource, MatTable are already in MatTableModule, so no need to import it again in #NgModule.
Remove MatTableDataSource from your shared -> import
Only import it in your component as import { MatTableDataSource} from #angular/material;
Import the module and enter it in your #NgModule Imports section. This is probably in your something.module.ts.
I had similar issue after upgrading to Angular 5, updating all the dependency like typescript, corejs , angular-cli etc to latest version solved the problem.
MatTableDataSource is in the master branch but it isn't added to the current version.
I hope this link can help you to make your own data source with the Abstract class "DataSource" in the module "#angular/cdk/collections"
https://github.com/angular/material2/issues/6036