triniwiz / triniwiz/nativescript-plugins

[nativescript-image-cache-it] TypeError: Cannot read property 'ɵcmp' of undefined

Open
#160 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
87
Forks
57
Avg merge
1h 36m
Merged PRs (30d)
4

Description

Which platform(s) does your issue occur on?
  • iOS/Android/Both: Android
  • iOS/Android versions: tested for Android 9-12
  • emulator or device. What type of device?: both, Pixel emulator and Samsung Note device
Please, provide the following version numbers that your issue occurs with:
  • CLI: (run tns --version to fetch it): 8.3
  • Cross-platform modules: (check the 'version' attribute in the
    node_modules/tns-core-modules/package.json file in your project)
  • Runtime(s): (look for the "tns-android" and "tns-ios" properties in the package.json file of your project): 8.3
  • Plugin(s): (look for the version numbers in the package.json file of your
    project and paste your dependencies and devDependencies here)
Please, tell us how to recreate the issue in as much detail as possible.

I upgraded to NativeScript 8.3 from 8.2, and since that, I am getting this error every time when image-cache-it is in use:

  JS: ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'ɵcmp' of undefined
  JS: TypeError: Cannot read property 'ɵcmp' of undefined
  JS:     at getComponentDef (file: src/webpack:/app/node_modules/@angular/core/fesm2015/core.js:1121:0)
  JS:     at extractDirectiveDef (file: src/webpack:/app/node_modules/@angular/core/fesm2015/core.js:945:0)
  JS:     at Array.map (<anonymous>)
  JS:     at def.directiveDefs (file: src/webpack:/app/node_modules/@angular/core/fesm2015/core.js:922:0)
  JS:     at createTView (file: src/webpack:/app/node_modules/@angular/core/fesm2015/core.js:9823:0)
  JS:     at getOrCreateTComponentView (file: src/webpack:/app/node_modules/@angular/core/fesm2015/core.js:9771:0)
  JS:     at addComponentLogic (file: src/webpack:/app/node_modules/@angular/core/fesm2015/core.js:10542:0)
  JS:     at instantiateAllDirectives (file: src/webpack:/app/node_modules/@angular/core/fesm2015/core.js:10383:0)

If I delete <ImageCacheIt .....></ImageCacheIt> from the template, this error doesn't appear and the app works as expected.

I am on Angular 12 because NS has routing issues with Angular 13/14. I can't install the latest version of your plugin because it requires Angular 14 :/

UPDATE:
I found a clue:

export 'ImageCacheItDirective' (imported as 'i1') was not found in '@triniwiz/nativescript-image-cache-it/angular' (possible exports: ImageCacheItModule, ɵa)

this doesn't appear when I use the latest version, but since it requires Angular 14 that breaks NS + Angular routing this plugin seems bugged with NS 8.3 + Angular 12

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure in a NativeScript 8.3 Android app using Angular 12 and @triniwiz/nativescript-image-cache-it, keeping the template element enabled. Start with the package's Angular integration and the reported missing ImageCacheItDirective export, then verify that the plugin works with this version combination without the ɵcmp error.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, angular
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.