ng-mocks giving error about imports with jest-preset-angular - jest-preset-angular

Using ng-mocks 13.5.2 with jest-preset-angular 12 and #ngneat/spectator 11 I am getting the below error any time I try to use MockComponents or MockPipe in my spec file.
I'm not sure why this is happening.
Must use import to load ES Module: /Users/scott/ltr/ltr/node_modules/#angular/core/fesm2020/core.mjs.
at Runtime.requireModule (node_modules/jest-runtime/build/index.js:1011:21)
at node_modules/ng-mocks/webpack:/ng-mocks/webpack/universalModuleDefinition:3:36
at Object.WEBPACK_EXTERNAL_MODULE__8900 (node_modules/ng-mocks/webpack:/ng-mocks/webpack/universalModuleDefinition:10:19)

The issue was reported and fixed, please use the latest version of ng-mocks: 14.0.1 or younger.
The problem was triggered by the node's flag: --experimental-vm-modules, which forces to use imports instead of require, whereas ng-mocks hadn't provided an esm build.
The fix was implemented here:
https://github.com/ike18t/ng-mocks/pull/2848
https://github.com/ike18t/ng-mocks/issues/2846

Related

cannot find symbol error: cannot find symbol import com.google.ads.mediation.facebook.FacebookAdapter;

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.

The 'graphlib' utility is a mandatory dependency

I am using joint js 3.1.1 version and graphlib 2.1.8 version.
I have a code in my app to check cyclic reference in graph. For that purpose I have written below code
graphlib.alg.findCycles(graph.toGraphLib())
This line gives following error
Uncaught Error: The the "graphlib" utility is a mandatory dependency.
at Object.toGraphLib (joint.min.js?de6d:8)
at child.He.toGraphLib (joint.min.js?de6d:8)
at RestrictCyclicConnection (links.js?2d1e:46)
at child.eval (businessobjectdesigner.vue?b25b:856)
at triggerEvents (backbone.js?ab5c:338)
at triggerApi (backbone.js?ab5c:322)
at eventsApi (backbone.js?ab5c:110)
at child.Events.trigger (backbone.js?ab5c:312)
at child.notify (joint.min.js?de6d:8)
at child._notifyConnectEvent (joint.min.js?de6d:8)
I have imported graphlib in my file also. But still getting following error.
I have imported graphlib as
import graphlib from 'graphlib'
You can try by passing graphlib as a part of the options object, as follows-
graph.toGraphLib({graphlib: graphlib})

angular 5 material MatTableDataSource

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

Elm Graphics.Input

I'm trying to run the Elm input examples from this page. Specifically, the Text Field example, and I'm getting an error saying that the Graphics.Input module is missing.
I've got this in a file called Main.elm:
import Graphics.Input as Input
main = let (field, state) = Input.field "Type here!"
in lift2 display field state
display field state =
field `above` asText state
If I run elm-server and navigate to localhost:8000, I get the error
Your browser may not be supported. Are you using a modern browser?
Runtime Error in Main module:
Error: Module 'Graphics.Input' is missing. Compile with --make flag or load missing module in a separate JavaScript file.
The problem may stem from an improper usage of:
Input.field, above
Compiling the project with elm --make Main.elm gives me
elm: Graphics/Input.elm: openFile: does not exist (No such file or directory)
Is there something extra I need to do to install the Graphic.Input?
Additional Notes:
I'm running this on a Debian machine, and installed it using cabal install elm fairly recently (Jun 15 2013). The current version is labeled Elm-0.7.1.1.
If I hop into the chromium JS prompt and poke around, it turns out there's no Elm.Graphics.Input module, but there is an Elm.Input. There isn't a function called field, there's a similar looking one called textField, but it isn't trivially interchangeable.
Running this:
import Input
main = let (field, state) = textField "Type here!"
in lift2 display field state
display field state =
field `above` asText state
gives me the error
Your browser may not be supported. Are you using a modern browser?
Runtime Error in Main module:
TypeError: a is undefined
The problem may stem from an improper usage of:
above
The Graphics.Input package is new in version 0.8. So, since you're running version 0.7, that explains your problem.
0.8 was released somewhat recently, but it's definitely been out longer than June 15th, so you probably just forgot to cabal update before installing it. Running cabal update now and then updating elm to 0.8 should fix your issue.

extra-paths not added to python path with zc.recipe.testrunner

I am trying to run tests by adding a version of tornado downloaded from github.com in the sys.path.
[tests]
recipe = zc.recipe.testrunner
extra-paths = ${buildout:directory}/parts/tornado/
defaults = ['--auto-color', '--auto-progress', '-v']
But when I run bin/tests I get the following error :
ImportError: No module named tornado
Am I not understanding how to use extra-paths ?
Martin
Have you tried looking into generated bin/tests script if it contains your path? It will tell definitely if your buildout.cfg is correct or not. Maybe problem is elsewhere. Because it seem that your code is ok.
If you happen to regularly include various branches from git/mercurial or elsewhere to buildout, you might be interested in mr.developer. mr.developer can download and add package to develop =. You wont need to set extra-path in every section.