Pein
Pein

Reputation: 443

NativeScript Version 8.2.1 : how to use old outdated plugins

I am new to NativeScript and Webpack and i have migrated my native script app from 6.5.1 to 8.2 version, and i am using nativescript-orientation-free plugin ,i am getting build errors as this plugin still refers to tns-core-modules which is no longer supported in Native Script 8 and i am getting below errors

ERROR in ./node_modules/nativescript-orientation-free/orientation.js 17:12-48 Module not found: Error: Can't resolve 'tns-core-modules/ui/enums' in '/Users/admin/Development/project/node_modules/nativescript-orientation-free'

ERROR in ./node_modules/nativescript-orientation-free/orientation.js 18:12-48 Module not found: Error: Can't resolve 'tns-core-modules/ui/frame' in '/Users/admin/Development/project/node_modules/nativescript-orientation-free'

we do not want to use this paid version pro-plugins-nativescript-orientation

orientation.js

can you please let me know how can i fix this issue? is there anything i can do in the webpack.config.js ? I am stuck here.

Upvotes: 1

Views: 519

Answers (2)

Pein
Pein

Reputation: 443

i removed this plugin and able to set the orientation without any third party plugins using

UIDevice.currentDevice.setValueForKey(1, "orientation");

Upvotes: 0

David
David

Reputation: 598

You have my sympathies. (A quote from the movie Alien.)

Migrating a NativeScript app from 6.5 to 8.x can be wildly frustrating due to all the breaking changes. Make sure you watch this video: Migrating Legacy NativeScript 6 Project to 8.

When Migrating my app I found I had to migrate several of the plugins I used. Patch-package is your friend! To answer your question, you'll need to revise the links you circled. Sometimes this is easy, sometimes this requires investigation.

These three should work:

import { Application as application } from '@nativescript/core';
const Enums = require("@nativescript/core/core-types").Enums;
import { Frame as frame } from '@nativescript/core';

I expect these two should work, 'tho I didn't use them in my project:

import { Page } from '@nativescript/core';
import { View as view } from '@nativescript/core';

Good luck!

Upvotes: 1

Related Questions