celsomtrindade
celsomtrindade

Reputation: 4671

Error when creating new Nativescript and Angular shared project

I'm trying to create a new project of Nativescript using the shared project option. However, as soon as I run ng new I have this error on the terminal:

An unhandled exception occurred: NOT SUPPORTED: keyword "id", use "$id" for schema ID See "/private/..../angular-errors.log" for further details.

This is the command I'm running:

ng new -c=@nativescript/schematics my-shared-app --shared --style=scss

And this is the version of my packages:

I've followed all the steps to install and create like said in the docs here: https://v7.docs.nativescript.org/angular/code-sharing/creating-a-new-project

When creating projects with nseverything works just fine. I can create the project, develop, test and run ins run android/iOS. For example, this command works:

ns create HelloWorld --template @nativescript/template-hello-world-ts

Any idea what's going on with this error?

Upvotes: 4

Views: 884

Answers (1)

Lorraine Ram-El
Lorraine Ram-El

Reputation: 2745

I think nativescript/schematics is no longer supported in nativescript 8. I tried this 2 months ago, and wasn't successful in using nativescript/schematics with {N}8. Their recommendation as appears here is to use other solutions such as Nrwl Nx DevTools code-sharing platform, that is used for code-sharing in monorepos. Their two recommendations are using it with @nativescript/nx or with @nstudio/xplat).

Here are 2 more links from my previous research, by Nathan Walker (one of the creators of nativescript) explaining how to use code sharing with xplat: xplat multi-platform tools for Nx workspaces with Nathan Walker

And a newer one for sharing code with NativeScript and Capacitor (the Ionic wrapper).

Upvotes: 3

Related Questions