Skip to content

Failed to change styleExt via cli #1905

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andrelmp opened this issue Aug 30, 2016 · 4 comments
Closed

Failed to change styleExt via cli #1905

andrelmp opened this issue Aug 30, 2016 · 4 comments
Assignees
Labels
needs: investigation Requires some digging to determine if action is needed

Comments

@andrelmp
Copy link
Contributor

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
    Windows 10 (x64)
  2. Versions. Please run ng --version. If there's nothing outputted, please run
    in a Terminal: node --version and paste the result here:
angular-cli: local (v1.0.0-beta.11-webpack.8, branch: master)
node: 6.4.0
os: win32 x64
  1. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.
    Crete a new project using: ng new Teste --style=sass
    then run ng set defaults.styleExt scss
  2. The log given by the failure. Normally this include a stack trace and some
    more information.
Cannot read property 'serialize' of undefined
TypeError: Cannot read property 'serialize' of undefined
    at D:\github\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:235:87
    at JsonSerializer.property (D:\github\angular-cli\addon\ng2\models\json-schema\serializer.ts:100:9)
    at _loop_1 (D:\github\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:235:32)
    at D:\github\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:240:17
    at JsonSerializer.object (D:\github\angular-cli\addon\ng2\models\json-schema\serializer.ts:88:9)
    at ObjectSchemaTreeNode.serialize (D:\github\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:227:20)
    at D:\github\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:231:92
    at JsonSerializer.property (D:\github\angular-cli\addon\ng2\models\json-schema\serializer.ts:100:9)
    at _loop_1 (D:\github\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:231:36)
    at D:\github\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:240:17
    at JsonSerializer.object (D:\github\angular-cli\addon\ng2\models\json-schema\serializer.ts:88:9)
    at ObjectSchemaTreeNode.serialize (D:\github\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:227:20)
    at D:\github\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:293:33
    at JsonSerializer.array (D:\github\angular-cli\addon\ng2\models\json-schema\serializer.ts:107:9)
    at ArraySchemaTreeNode.serialize (D:\github\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:291:20)
    at D:\github\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:231:92
    at JsonSerializer.property (D:\github\angular-cli\addon\ng2\models\json-schema\serializer.ts:100:9)
    at _loop_1 (D:\github\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:231:36)
    at D:\github\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:240:17
    at JsonSerializer.object (D:\github\angular-cli\addon\ng2\models\json-schema\serializer.ts:88:9)
    at RootSchemaTreeNode.ObjectSchemaTreeNode.serialize (D:\github\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:227:20)
    at GeneratedSchemaClass.SchemaClassBase.$$serialize (D:\github\angular-cli\addon\ng2\models\json-schema\schema-class-factory.ts:141:25)
  1. Mention any other details that might be useful.

Thanks! We'll be in touch soon.

@pinoyyid
Copy link

Me too. Ubuntu 16.04
ng --version
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
angular-cli: 1.0.0-beta.14
node: 6.2.2
os: linux x64

@leprkhn
Copy link

leprkhn commented Sep 19, 2016

I also have this problem.

Mint 18 (Ubuntu 16.04)

ng --version

Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
angular-cli: 1.0.0-beta.14
node: 6.6.0
os: linux x64
ng set defaults.styleExt scss

Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
Cannot read property 'serialize' of undefined
TypeError: Cannot read property 'serialize' of undefined
    at /home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/json-schema/schema-tree.js:235:87
    at JsonSerializer.property (/home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/json-schema/serializer.js:100:9)
    at _loop_1 (/home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/json-schema/schema-tree.js:235:32)
    at /home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/json-schema/schema-tree.js:240:17
    at JsonSerializer.object (/home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/json-schema/serializer.js:88:9)
    at ObjectSchemaTreeNode.serialize (/home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/json-schema/schema-tree.js:227:20)
    at /home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/json-schema/schema-tree.js:231:92
    at JsonSerializer.property (/home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/json-schema/serializer.js:100:9)
    at _loop_1 (/home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/json-schema/schema-tree.js:231:36)
    at /home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/json-schema/schema-tree.js:240:17
    at JsonSerializer.object (/home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/json-schema/serializer.js:88:9)
    at ObjectSchemaTreeNode.serialize (/home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/json-schema/schema-tree.js:227:20)
    at /home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/json-schema/schema-tree.js:293:33
    at JsonSerializer.array (/home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/json-schema/serializer.js:107:9)
    at ArraySchemaTreeNode.serialize (/home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/json-schema/schema-tree.js:291:20)
    at /home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/json-schema/schema-tree.js:231:92
    at JsonSerializer.property (/home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/json-schema/serializer.js:100:9)
    at _loop_1 (/home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/json-schema/schema-tree.js:231:36)
    at /home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/json-schema/schema-tree.js:240:17
    at JsonSerializer.object (/home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/json-schema/serializer.js:88:9)
    at RootSchemaTreeNode.ObjectSchemaTreeNode.serialize (/home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/json-schema/schema-tree.js:227:20)
    at GeneratedSchemaClass.SchemaClassBase.$$serialize (/home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/json-schema/schema-class-factory.js:141:25)
    at CliConfig.serialize (/home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/config/config.js:37:29)
    at CliConfig.save (/home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/models/config/config.js:33:44)
    at /home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/commands/set.js:49:20
    at Class.run (/home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/commands/set.js:31:16)
    at Class.<anonymous> (/home/leprkhn/Projects/angular2-hackernews/node_modules/angular-cli/lib/models/command.js:152:17)
    at tryCatch (/home/leprkhn/Projects/angular2-hackernews/node_modules/rsvp/dist/lib/rsvp/-internal.js:215:12)
    at invokeCallback (/home/leprkhn/Projects/angular2-hackernews/node_modules/rsvp/dist/lib/rsvp/-internal.js:230:13)
    at publish (/home/leprkhn/Projects/angular2-hackernews/node_modules/rsvp/dist/lib/rsvp/-internal.js:198:7)
    at flush (/home/leprkhn/Projects/angular2-hackernews/node_modules/rsvp/dist/lib/rsvp/asap.js:82:5)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

My current workaround is to edit

./angular-cli.json

From

"defaults": {
    "styleExt": "css"
}

To

"defaults": {
    "styleExt": "scss"
}

And

./app/app.component.ts

From

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})

To

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})

And finally rename ./app/app.component.css to ./app/app.component.scss

@filipesilva filipesilva added the needs: investigation Requires some digging to determine if action is needed label Sep 20, 2016
@filipesilva filipesilva self-assigned this Sep 20, 2016
@filipesilva
Copy link
Contributor

Dupe of #1900

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: investigation Requires some digging to determine if action is needed
Projects
None yet
Development

No branches or pull requests

4 participants