Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Can't resolve 'tns-core-modules/ui' #51

Open
panagulis72 opened this issue Feb 12, 2020 · 4 comments
Open

Error: Can't resolve 'tns-core-modules/ui' #51

panagulis72 opened this issue Feb 12, 2020 · 4 comments

Comments

@panagulis72
Copy link

Hi,
when I build my application for android it works, but when I build for ios (tns build ios --env.uglify --env.aot --env.snapshot) I get the following error:

ERROR in ../node_modules/nativescript-social-share/social-share.js
Module not found: Error: Can't resolve 'tns-core-modules/ui' in '/Users/user/Documents/app/node_modules/nativescript-social-share'
@ ../node_modules/nativescript-social-share/social-share.js 4:11-41
@ ../$$_lazy_route_resource lazy namespace object
@ ../node_modules/@angular/core/fesm5/core.js
@ ./main.ts
Executing webpack failed with exit code 2.

These are the versione in package.json:
"tns-core-modules": "6.0.1",
"nativescript-social-share": "^1.5.2"

I tried to update nativescript-social-share to last versione but it doesnt work. Unfortunatly, I cannot update core-modules to 6.2

@panagulis72
Copy link
Author

I saw that the error comes from social-share.ios.js, with this it works:

var frame_1 = require("tns-core-modules/ui/frame");
......
 var page = frame_1.topmost().currentPage;

@drewjbartlett
Copy link

@panagulis72 how are you able to fix this since it's built in your node_modules?

@vivek-aecor
Copy link

Hi,
when I build my application for android it works, but when I build for ios so i get the following error:
for console.log("topmost() is deprecated. Use Frame.topmost() instead.");

These are the versione in package.json:
"tns-core-modules": "^6.4.2",
"nativescript-social-share": "1.6.0",

@nbeers22
Copy link

nbeers22 commented May 13, 2020

@panagulis72 how are you able to fix this since it's built in your node_modules?

@drewjbartlett - if you go to node_modules/nativescript-social-share/social-share.ios.js you can update the code there.

`
var utils_1 = require("tns-core-modules/utils/utils");

// var ui_1 = require("tns-core-modules/ui");

var frame_1 = require("tns-core-modules/ui/frame");

function share(thingsToShare) {

    var activityController = UIActivityViewController.alloc()

        .initWithActivityItemsApplicationActivities(thingsToShare, null);

    var presentViewController = activityController.popoverPresentationController;

    if (presentViewController) {

        var page = frame_1.topmost().currentPage;

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants