Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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:

  • MacBook Air m1
  • Node v16.13.0
  • Npm v8.1.0
  • NS v8.1.5
  • Angular CLI 13.1.2

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?

like image 585
celsomtrindade Avatar asked Oct 19 '25 03:10

celsomtrindade


1 Answers

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).

like image 84
Lorraine R. Avatar answered Oct 20 '25 16:10

Lorraine R.