Missing refs while upgrading a Nativescript plugin (tns-core-modules → #nativescript/core migration) - nativescript

I'm updating an existing plugin in order to make it compatible with the upcoming nativescript release.
All references to the tns-core-modules package have been replaced with #nativescript/core.
The released documentation says that the new libraries should be retro-compatible with older versions. Unfortunately in this case something must have changed (related to the view lifecycle), and the plugin is not 100% working.
That's why I attempted a full migration of it's dependencies, but the build process was not possible due to some errors:
node_modules/#nativescript/core/ui/frame/index.d.ts:494:38 - error TS2304: Cannot find name 'ModuleContext'.
494 export function reloadPage(context?: ModuleContext): void;
...
map-view.ios.ts:80:40 - error TS2304: Cannot find name 'WeakRef'.
80 public static initWithOwner(owner: WeakRef<MapView>): MapViewDelegateImpl {
node_modules/#nativescript/core/ui/styling/style/index.d.ts:31:39 - error TS2304: Cannot find name 'WeakRef'.
31 constructor(ownerView: ViewBase | WeakRef<ViewBase>);
I can build the plugin by setting skipLibCheck: true in tsconfig.json. It makes the plugin compile, but the problem comes out later at runtime.
So it must be solved to complete the migration.
Any hints?
Thank you!

Maybe it's not the 100% recommended solution, but in case that the same problem does happen to you, add this line to your tsconfig.json:
"types": [
"#nativescript/core",
],

Related

add pallet_assets error: ^^^ Config not found in 'pallet_assets'

I get this error when trying to compile and I seem to be unable to solve it...:
In terminal, after running 'cargo check' I get:
Compiling node-template-runtime v2.0.1 (/runtime)
error[E0405]: cannot find trait `Config` in crate `pallet_assets`
--> /runtime/src/lib.rs:360:21
|
360 | impl pallet_assets::Config for Runtime {
| ^^^^^^ not found in `pallet_assets`
error: aborting due to previous error...
I tried with 'Trait' instead of Config, but throws even more errors...?
A hint would be much appreciated. Thanks
The Config trait was introduced in version 3.0.0 of substrate. As you pointed out, it was previously Trait. It is only expected for any substrate project to be compile-able if you use all of the same major version (2.x or 3.x) for building. I highly recommend using v3+ from now on, v2 is not expected to be supported moving forward.

errorE0282# type annotations needed & could not compile `sp-arithmetic`

I am following tutorial [Implementing the Contract Trait]. Added code snip to [parameter_types!] and to [imp trait runtime].
When I run [cargo check -p node-template-runtime] receive error:
error[E0282]: type annotations needed
error: could not compile sp-arithmetic
note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
I've had this error previously and it was due to nightly?
I am using windows not mac..
Just to Add to #dundro answer. Go to the link he suggested:
https://github.com/substrate-developer-hub/substrate-node-template/commit/5769470053ba48f364100ff106e32f1beea43127
and download the "rust-toolchain" file. Then place it in the "substrate-node-template" folder. Then try to build again using the command "cargo build --release".
In my case, it solved the E0282 error and gave me a new one E0463. Searching for a fix now
I got the exactly same error, but then I just checked out master ( there is now a toolchain file since https://github.com/substrate-developer-hub/substrate-node-template/commit/5769470053ba48f364100ff106e32f1beea43127)
and with nightly-2020-10-06 the build was successful.
Good luck
Solved: I forgot to add nightly [cargo +nightly-2020-10-06 check -p node-template-runtime]..

cordova windows error: "cordova/windows8/commandProxy" not found

I have built a Cordova-based Windows application. As soon as I add any plugin, the app starts crashing with the exception cordova/windows8/commandProxy not found.
Cordova version: 4.3.0
It seems that cordova/windows8/commandProxy is deprecated in Cordova 4.3.0.
I have replaced this statement in plugin file
require("cordova/windows8/commandProxy")
to
require("cordova/exec/proxy")
and it seems to work.
For example I changed line number 18 in PushPluginProxy.js from
require("cordova/windows8/commandProxy").add("PushPlugin", module.exports);
to
require("cordova/exec/proxy").add("PushPlugin", module.exports);
The name in the string varies depending on the plugin.
Alternatively, you can patch the plugin like in this pull request from the AppVersion plugin i.e.:
Change
require("cordova/windows8/commandProxy").add("AppVersion", AppVersionProxy);
to
cordova.commandProxy.add("AppVersion", AppVersionProxy);

Hipster stack (Yeoman + Maven + Spring) Error

When I tried to generate with yo jhipster on Windows 7 32 bits machine, I got the below error:
bower json3#~3.2.5 progress received 3.7MB of 4.9MB
downloaded, 75% libjpeg-62.dll: downloading [===================]
100% 0.0s
? pre-build test failed, compiling from source...
d:\Self_jhipster\node_modules\grunt-contrib-imagemin\node_modules\jpegtran-bin\
lib\check.js:19
throw new Error('building is not supported on ' + process.platform);
^ Error: building is not supported on win32
at d:\Self_jhipster\node_modules\grunt-contrib-imagemin\node_modules\jpegtran-bin\lib\check.js:19:10
How to solve this error?
I'm the author of http://jhipster.github.io/ which is the generator your are referring to.
I have found your problem, it is indeed a bug in jpegtran-bin. I have updated all the dependencies in Grunt.js, and it should now work fine on Windows.
This will be commited in the next release (0.2.1), which should be out in a few hours.
You can also submit a bug at https://github.com/jhipster/generator-jhipster/issues
After google with more correct keywords, the solution from https://github.com/gruntjs/grunt-contrib-imagemin/issues/109 works for me.
In application's package.json, add "jpegtran-bin": "0.2.0" before
the reference for imagemin,
Remove node_module folder locally.
Run npm install again.

EmguCV 'Emgu.CV.CvInvoke' Exception

I have installed EmguCV 2.4.2.1777. I have a 32-bit windows 7 so I installed it using the installer. Now I am trying to write a simple code to capture a webcam's video in a window in C#.
The problem is after during execution I am getting the following famous error:
A first chance exception of type 'System.DllNotFoundException' occurred in Emgu.CV.dll
A first chance exception of type 'System.TypeInitializationException' occurred in Emgu.CV.dll
An unhandled exception of type 'System.TypeInitializationException' occurred in Emgu.CV.dll
The file Emgu.CV.dll is present in the folder. I don't understand why its giving that error.
I tried all the checks which are suggested by fellow stackoverflow users and also many other references:
1) Installed MSVCR: MSVCRT 10.0 SP1 x86
2) copied the OpenCV dlls to the execution directory
3) I also have a 32-bit OS. So that also should'nt be an issue.
But when I checked for dependencies, I faced a problem:
I used DependecyWalker to open cvextern.dll and found the following dependencies missing:
NVCUDA.DLL
API-MS-WIN-CORE-COM-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-ERROR-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-ROBUFFER-L1-1-0.DLL
API-MS-WIN-CORE-WINRT-STRING-L1-1-0.DLL
API-MS-WIN-SHCORE-SCALING-L1-1-0.DLL
DCOMP.DLL
IESHIMS.DLL
It also gave the following:
Error: At least one required implicit or forwarded dependency was not found.
Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
Please help me out with the exception. Thanks in advance.
I copied all the dll files from C:\Emgu\emgucv-windows-universal-gpu 2.4.9.1847\bin\x86 to a folder called includes in my project and updated the "Copy To Output Directory" Option for these DLLs to "Copy Always" and it got rid of this issue.

Resources