nativescript-schematics icon indicating copy to clipboard operation
nativescript-schematics copied to clipboard

@nativescript/schematics problem : cloudn't generate .scss file by using ng-cli

Open Tonysmark opened this issue 5 years ago • 4 comments

running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: @angular/cli 8.3.0
  • Node: 12.7.0
  • Cross-platform modules: Angular 8.2.3
  • Android Runtime:
  • iOS Runtime: none
  • Plugin(s): @nativescript/schematics

Describe the bug from this pageangular-cli ,and I run this two command line:

npm i --save-dev @angular/cli
npm i --save-dev @nativescript/schematics

then I thought maybe I could generate a component by using

ng g c pages/landing --style=scss

however I got this:

Unknown option: '--style'

And then I thought maybe I could modify angular.json file in this project in order to generate scss file, here is what I change

 "schematics": { "@schematics/angular:component": { "style": "sass" } }

then I got this:

Failed to find generated component file /landing.component.css. Please contact the @nativescript/schematics author.

Tonysmark avatar Aug 23 '19 07:08 Tonysmark

I'm having this issue as well. I can confirm that --style=scss works in a non-nativescript angular project, but not in a nativescript project. I updated angular/cli to latest.

New components that are generated (without the --style option) by the cli will not generate .scss files, only .css, which I need to then rename. I set this in angular.json

"schematics": {
    "@schematics/angular:component": {
      "styleext": "scss"
    }
  }

Sass is working in general, though.

eugenehiggins avatar Sep 05 '19 18:09 eugenehiggins

I'm getting the same error when wanting to specify inline-styles with with the --inline-style flag or -s shortcut. I've updated the angular.json file and it works fine when not specifying the --inline-style flag

rodp82 avatar Nov 12 '19 03:11 rodp82

I'm running into the exact same problem as described by eugenehiggins. Is there a solution for this problem?

wschroers avatar Jan 22 '20 10:01 wschroers

downgrading the schematics version in angular.json worked for me. Changed it to below version. "@nativescript/schematics": "^0.2.4",

AjayPratapSrivas avatar May 04 '20 12:05 AjayPratapSrivas