4

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?

3
  • same problem here trying to add nativescript/schematics to an existing angular v13 project Commented Jan 10, 2022 at 20:55
  • @Rebolon it seems that those schematics are out of date. Nativescript itself is recommending using Nx for that purpose. Commented Jan 10, 2022 at 22:17
  • @celsomtrindate thanx i've seen this, but i'm not satisfied with the fact of adding a new item in the stack only to be able to share code between web and native. No solution for instance, and a bit sad. Commented Jan 18, 2022 at 16:30

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.