Trying to use sass on main global stylesheet:
ng set defaults.styleExt scss
Error:
Cannot read property 'serialize' of undefined
TypeError: Cannot read property 'serialize' of undefined
at /Users/lorne/projects/hsi-magazine/node_modules/angular-cli/addon/ng2/models/json-schema/schema-tree.ts:235:87
at JsonSerializer.property (/Users/lorne/projects/hsi-magazine/node_modules/angular-cli/addon/ng2/models/json-schema/serializer.ts:100:9)
at _loop_1 (/Users/lorne/projects/hsi-magazine/node_modules/angular-cli/addon/ng2/models/json-schema/schema-tree.ts:235:32)
at /Users/lorne/projects/hsi-magazine/node_modules/angular-cli/addon/ng2/models/json-schema/schema-tree.ts:240:17
at JsonSerializer.object (/Users/lorne/projects/hsi-magazine/node_modules/angular-cli/addon/ng2/models/json-schema/serializer.ts:88:9)
at ObjectSchemaTreeNode.serialize (/Users/lorne/projects/hsi-magazine/node_modules/angular-cli/addon/ng2/models/json-schema/schema-tree.ts:227:20)
at /Users/lorne/projects/hsi-magazine/node_modules/angular-cli/addon/ng2/models/json-schema/schema-tree.ts:231:92
at JsonSerializer.property (/Users/lorne/projects/hsi-magazine/node_modules/angular-cli/addon/ng2/models/json-schema/serializer.ts:100:9)
at _loop_1 (/Users/lorne/projects/hsi-magazine/node_modules/angular-cli/addon/ng2/models/json-schema/schema-tree.ts:231:36)
at /Users/lorne/projects/hsi-magazine/node_modules/angular-cli/addon/ng2/models/json-schema/schema-tree.ts:240:17
at JsonSerializer.object (/Users/lorne/projects/hsi-magazine/node_modules/angular-cli/addon/ng2/models/json-schema/serializer.ts:88:9)
at ObjectSchemaTreeNode.serialize (/Users/lorne/projects/hsi-magazine/node_modules/angular-cli/addon/ng2/models/json-schema/schema-tree.ts:227:20)
at /Users/lorne/projects/hsi-magazine/node_modules/angular-cli/addon/ng2/models/json-schema/schema-tree.ts:293:33
at JsonSerializer.array (/Users/lorne/projects/hsi-magazine/node_modules/angular-cli/addon/ng2/models/json-schema/serializer.ts:107:9)
at ArraySchemaTreeNode.serialize (/Users/lorne/projects/hsi-magazine/node_modules/angular-cli/addon/ng2/models/json-schema/schema-tree.ts:291:20)
at /Users/lorne/projects/hsi-magazine/node_modules/angular-cli/addon/ng2/models/json-schema/schema-tree.ts:231:92
at JsonSerializer.property (/Users/lorne/projects/hsi-magazine/node_modules/angular-cli/addon/ng2/models/json-schema/serializer.ts:100:9)
at _loop_1 (/Users/lorne/projects/hsi-magazine/node_modules/angular-cli/addon/ng2/models/json-schema/schema-tree.ts:231:36)
at /Users/lorne/projects/hsi-magazine/node_modules/angular-cli/addon/ng2/models/json-schema/schema-tree.ts:240:17
at JsonSerializer.object (/Users/lorne/projects/hsi-magazine/node_modules/angular-cli/addon/ng2/models/json-schema/serializer.ts:88:9)
at RootSchemaTreeNode.ObjectSchemaTreeNode.serialize (/Users/lorne/projects/hsi-magazine/node_modules/angular-cli/addon/ng2/models/json-schema/schema-tree.ts:227:20)
at GeneratedSchemaClass.SchemaClassBase.$$serialize (/Users/lorne/projects/hsi-magazine/node_modules/angular-cli/addon/ng2/models/json-schema/schema-class-factory.ts:141:25)
Can confirm this, here are the steps to replicate this issue:
Well I have been using angular cli for about two months working on a large
app with lots of different libraries installed. So my problem could be to
do with upgrading as well. I did follow the guide :)
On Wednesday, 31 August 2016, Ricardo Varanda [email protected]
wrote:
Can confirm this, here are the steps to replicate this issue:
- Create angular-cli project beta 10
- Update angular-cli to latest webpack following:
https://github.com/angular/angular-cli/blob/master/WEBPACK_UPDATE.md
https://github.com/angular/angular-cli/blob/master/WEBPACK_UPDATE.md- use the following command in terminal: ng set defaults.styleExt scss
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/angular/angular-cli/issues/1900#issuecomment-243623331,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEUSGj5fjoOJBeK4l_wvyYQZt0evVcAaks5qlMqKgaJpZM4Jwqrj
.
I received the same exact error with 'ng set defaults.styleExt less' after upgrading my app this morning.
Error:
TypeError: Cannot read property 'serialize' of undefined
at C:gitaws.clientsoms-allocation-testingnode_modulesangular-cliaddonng2modelsjson-schemaschema-tree.ts:235:87
at JsonSerializer.property (C:gitaws.clientsoms-allocation-testingnode_modulesangular-cliaddonng2modelsjson-schemaserializer.ts:100:9)
at _loop_1 (C:gitaws.clientsoms-allocation-testingnode_modulesangular-cliaddonng2modelsjson-schemaschema-tree.ts:235:32)
at C:gitaws.clientsoms-allocation-testingnode_modulesangular-cliaddonng2modelsjson-schemaschema-tree.ts:240:17
at JsonSerializer.object (C:gitaws.clientsoms-allocation-testingnode_modulesangular-cliaddonng2modelsjson-schemaserializer.ts:88:9)
at ObjectSchemaTreeNode.serialize (C:gitaws.clientsoms-allocation-testingnode_modulesangular-cliaddonng2modelsjson-schemaschema-tree.ts:227:20)
at C:gitaws.clientsoms-allocation-testingnode_modulesangular-cliaddonng2modelsjson-schemaschema-tree.ts:231:92
at JsonSerializer.property (C:gitaws.clientsoms-allocation-testingnode_modulesangular-cliaddonng2modelsjson-schemaserializer.ts:100:9)
at _loop_1 (C:gitaws.clientsoms-allocation-testingnode_modulesangular-cliaddonng2modelsjson-schemaschema-tree.ts:231:36)
at C:gitaws.clientsoms-allocation-testingnode_modulesangular-cliaddonng2modelsjson-schemaschema-tree.ts:240:17
at JsonSerializer.object (C:gitaws.clientsoms-allocation-testingnode_modulesangular-cliaddonng2modelsjson-schemaserializer.ts:88:9)
at ObjectSchemaTreeNode.serialize (C:gitaws.clientsoms-allocation-testingnode_modulesangular-cliaddonng2modelsjson-schemaschema-tree.ts:227:20)
at C:gitaws.clientsoms-allocation-testingnode_modulesangular-cliaddonng2modelsjson-schemaschema-tree.ts:293:33
at JsonSerializer.array (C:gitaws.clientsoms-allocation-testingnode_modulesangular-cliaddonng2modelsjson-schemaserializer.ts:107:9)
at ArraySchemaTreeNode.serialize (C:gitaws.clientsoms-allocation-testingnode_modulesangular-cliaddonng2modelsjson-schemaschema-tree.ts:291:20)
at C:gitaws.clientsoms-allocation-testingnode_modulesangular-cliaddonng2modelsjson-schemaschema-tree.ts:231:92
at JsonSerializer.property (C:gitaws.clientsoms-allocation-testingnode_modulesangular-cliaddonng2modelsjson-schemaserializer.ts:100:9)
at _loop_1 (C:gitaws.clientsoms-allocation-testingnode_modulesangular-cliaddonng2modelsjson-schemaschema-tree.ts:231:36)
at C:gitaws.clientsoms-allocation-testingnode_modulesangular-cliaddonng2modelsjson-schemaschema-tree.ts:240:17
at JsonSerializer.object (C:gitaws.clientsoms-allocation-testingnode_modulesangular-cliaddonng2modelsjson-schemaserializer.ts:88:9)
at RootSchemaTreeNode.ObjectSchemaTreeNode.serialize (C:gitaws.clientsoms-allocation-testingnode_modulesangular-cliaddonng2modelsjson-schemaschema-tree.ts:227:20)
at GeneratedSchemaClass.SchemaClassBase.$$serialize (C:gitaws.clientsoms-allocation-testingnode_modulesangular-cliaddonng2modelsjson-schemaschema-class-factory.ts:141:25)
[email protected] is what was installed with the update.
$ ng --version
angular-cli: 1.0.0-beta.11-webpack.8
node: 5.7.1
os: win32 ia32
$ node --version
v5.7.1
Same issue as #1905
I did get it to work manually by setting the default style extension to scss in angular-cli.json. I also had to restart the server.
What's that line look like in angular-cli.json, to use scss?
"defaults": {
"styleExt": "scss" }
SCSS was introduced as the new "main syntax" in version 3, six years ago: https://github.com/sass/sass/releases/tag/3.0.0
I feel like the .sass extension should be deprecated :P Are people still using it?
@borntodesign I follow your steps manually setting the styleExt to scss, but if I rename the main style.css to style.scss I get the following error:
ERROR in multi styles
Module not found: Error: Can't resolve '/src/styles.css' in '/node_modules/angular-cli/models'
@ multi styles
Did you have to change anything else?
@omargon I believe you have to change the styles within your angular-cli.json to:
"styles": [
"styles.scss"
],
Of course make sure you restart your server as well ;) something I did not
do at first lol
On Tuesday, 27 September 2016, RomanTheOne [email protected] wrote:
@omargon https://github.com/omargon I believe you have to change the
styles within your angular-cli.json to:
"styles": [
"styles.scss"
],—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/angular/angular-cli/issues/1900#issuecomment-249736466,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEUSGp-j2X8JdPg8VP4HDBmlBgyS_i8uks5quGStgaJpZM4Jwqrj
.
To be clear, the real but here is that ng set defaults.styleExt scss doesn't work, but should. We'll fix it.
Same thing applies to ng set defaults.styleExt less
The issue is in the ng set command so anything that comes after more than likely will give you an error, give it time as Filipe Silva said it's already on the Angular reams list of things to fix :)
Can we re-open this as it is still reproducing with angular-cli: 1.0.0-beta.17
cc @filipesilva @borntodesign
@lirantal This fix was only merged in the recent 1.0.0-beta.18:
See
https://github.com/angular/angular-cli/blob/master/CHANGELOG.md#100-beta18-2016-10-20
Got it, thanks for clearing this up!
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._
Most helpful comment
"defaults": {
"styleExt": "scss" }