nativescript-community / ui-image

Advanced and efficient image display plugin which uses Fresco (Android) and SDWebImage (iOS) to implement caching, placeholders, image effects, and much more.
Apache License 2.0
36 stars 9 forks source link

nativescript-image modul - wrong inclusions found #36

Closed markosole closed 3 years ago

markosole commented 3 years ago

Hi all,

I have migrated one of my projects to nativescript 7 and during build time I came across of error which reported that ERROR in ../node_modules/nativescript-image/image.js Module not found: Error: Can't resolve 'tns-core-modules/platform/platform' @ ../node_modules/nativescript-image/image.js 13:17-62

Which is error in var platform_1 = require("@nativescript/core/platform/platform");

Example code below, file> node_modules/nativescript-image/image.ios.js

var fs = require("@nativescript/core/file-system"); var image_asset_1 = require("@nativescript/core/image-asset"); var image_source_1 = require("@nativescript/core/image-source"); var platform_1 = require("@nativescript/core/platform/platform"); var view_1 = require("@nativescript/core/ui/core/view"); var types_1 = require("@nativescript/core/utils/types"); var utils_1 = require("@nativescript/core/utils/utils");

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

I have not tried to reproduce it.

Is there any code involved?

var platform_1 = require("@nativescript/core/platform/platform");

Resolution: changing line of code above to: var platform_1 = require("@nativescript/core/platform"); by removing extra one /platform

farfromrefug commented 3 years ago

@markosole there is no such code in that repo. I dont think the error comes from this plugin. If you can give more info and assure it comes from here i ll reopen

markosole commented 3 years ago

I have installed plugin nativescript-image, which after installation throws error described above. When I correct /platform/platform part it works perfectly. NOTE: file effected is node_modules/nativescript-image/image.ios.js

Line of code: 9.

I did remove node_modules and hooks folder, removed nativescript-image plugin and added it again. Than same thing happened. It could be because of ns migrate I have used to migrate old tns 6.x to ns 7.x.

I am not sure how is image.ios.js generated from ts and what is going on in there.

farfromrefug commented 3 years ago

@markosole you are using nativescript-image which is not for N 7. Use @nativescript-community/ui-image

samiul-gtmi commented 2 years ago

@farfromrefug does it mean that nativescript-image can't be used in NS7 or NS8 and beyond? I am facing an error somewhat similar to this, and was wondering about it because the documentation for nativescript-image has nothing written about this in it.

farfromrefug commented 2 years ago

@samiul-gtmi as mentioned you need to migrate to @nativescript-community/ui-image