Skip to content
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

Cannot read property 'serialize' of undefined #1900

Closed
borntodesign opened this issue Aug 30, 2016 · 20 comments
Closed

Cannot read property 'serialize' of undefined #1900

borntodesign opened this issue Aug 30, 2016 · 20 comments
Assignees
Labels
P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful type: bug/fix

Comments

@borntodesign
Copy link

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)

@RicardoVaranda
Copy link
Contributor

Can confirm this, here are the steps to replicate this issue:

  1. Create angular-cli project beta 10
  2. Update angular-cli to latest webpack following:
    https://github.com/angular/angular-cli/blob/master/WEBPACK_UPDATE.md
  3. use the following command in terminal:
    ng set defaults.styleExt scss

@borntodesign
Copy link
Author

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 notifications@github.com
wrote:

Can confirm this, here are the steps to replicate this issue:

  1. Create angular-cli project beta 10
  2. 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
  3. 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
#1900 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEUSGj5fjoOJBeK4l_wvyYQZt0evVcAaks5qlMqKgaJpZM4Jwqrj
.

@neojack647
Copy link

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:\git\aws.clients\oms-allocation-testing\node_modules\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:235:87
at JsonSerializer.property (C:\git\aws.clients\oms-allocation-testing\node_modules\angular-cli\addon\ng2\models\json-schema\serializer.ts:100:9)
at _loop_1 (C:\git\aws.clients\oms-allocation-testing\node_modules\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:235:32)
at C:\git\aws.clients\oms-allocation-testing\node_modules\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:240:17
at JsonSerializer.object (C:\git\aws.clients\oms-allocation-testing\node_modules\angular-cli\addon\ng2\models\json-schema\serializer.ts:88:9)
at ObjectSchemaTreeNode.serialize (C:\git\aws.clients\oms-allocation-testing\node_modules\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:227:20)
at C:\git\aws.clients\oms-allocation-testing\node_modules\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:231:92
at JsonSerializer.property (C:\git\aws.clients\oms-allocation-testing\node_modules\angular-cli\addon\ng2\models\json-schema\serializer.ts:100:9)
at _loop_1 (C:\git\aws.clients\oms-allocation-testing\node_modules\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:231:36)
at C:\git\aws.clients\oms-allocation-testing\node_modules\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:240:17
at JsonSerializer.object (C:\git\aws.clients\oms-allocation-testing\node_modules\angular-cli\addon\ng2\models\json-schema\serializer.ts:88:9)
at ObjectSchemaTreeNode.serialize (C:\git\aws.clients\oms-allocation-testing\node_modules\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:227:20)
at C:\git\aws.clients\oms-allocation-testing\node_modules\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:293:33
at JsonSerializer.array (C:\git\aws.clients\oms-allocation-testing\node_modules\angular-cli\addon\ng2\models\json-schema\serializer.ts:107:9)
at ArraySchemaTreeNode.serialize (C:\git\aws.clients\oms-allocation-testing\node_modules\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:291:20)
at C:\git\aws.clients\oms-allocation-testing\node_modules\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:231:92
at JsonSerializer.property (C:\git\aws.clients\oms-allocation-testing\node_modules\angular-cli\addon\ng2\models\json-schema\serializer.ts:100:9)
at _loop_1 (C:\git\aws.clients\oms-allocation-testing\node_modules\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:231:36)
at C:\git\aws.clients\oms-allocation-testing\node_modules\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:240:17
at JsonSerializer.object (C:\git\aws.clients\oms-allocation-testing\node_modules\angular-cli\addon\ng2\models\json-schema\serializer.ts:88:9)
at RootSchemaTreeNode.ObjectSchemaTreeNode.serialize (C:\git\aws.clients\oms-allocation-testing\node_modules\angular-cli\addon\ng2\models\json-schema\schema-tree.ts:227:20)
at GeneratedSchemaClass.SchemaClassBase.$$serialize (C:\git\aws.clients\oms-allocation-testing\node_modules\angular-cli\addon\ng2\models\json-schema\schema-class-factory.ts:141:25)

@neojack647
Copy link

angular-cli@1.0.0-beta.11-webpack.8 is what was installed with the update.

@neojack647
Copy link

$ ng --version
angular-cli: 1.0.0-beta.11-webpack.8
node: 5.7.1
os: win32 ia32
$ node --version
v5.7.1

@neojack647
Copy link

Same issue as #1905

@borntodesign
Copy link
Author

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.

@dessalines
Copy link

What's that line look like in angular-cli.json, to use scss?

@johnkorzhuk
Copy link

johnkorzhuk commented Sep 4, 2016

"defaults": {
"styleExt": "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 filipesilva added type: bug/fix P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful and removed needs: investigation Requires some digging to determine if action is needed labels Sep 20, 2016
@intellix
Copy link
Contributor

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?

@omargon
Copy link

omargon commented Sep 26, 2016

@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?

@RomanTheOne
Copy link

@omargon I believe you have to change the styles within your angular-cli.json to:
"styles": [ "styles.scss" ],

@borntodesign
Copy link
Author

Of course make sure you restart your server as well ;) something I did not
do at first lol

On Tuesday, 27 September 2016, RomanTheOne notifications@github.com 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
#1900 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEUSGp-j2X8JdPg8VP4HDBmlBgyS_i8uks5quGStgaJpZM4Jwqrj
.

@filipesilva
Copy link
Contributor

To be clear, the real but here is that ng set defaults.styleExt scss doesn't work, but should. We'll fix it.

@skovmand
Copy link

skovmand commented Oct 6, 2016

Same thing applies to ng set defaults.styleExt less

@RicardoVaranda
Copy link
Contributor

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

JJayet pushed a commit to JJayet/angular-cli that referenced this issue Oct 14, 2016
Brocco pushed a commit that referenced this issue Oct 19, 2016
@lirantal
Copy link

Can we re-open this as it is still reproducing with angular-cli: 1.0.0-beta.17
cc @filipesilva @borntodesign

@RicardoVaranda
Copy link
Contributor

@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

@lirantal
Copy link

Got it, thanks for clearing this up!

texel pushed a commit to splice/angular-cli that referenced this issue Nov 3, 2016
@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
P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful type: bug/fix
Projects
None yet
Development

Successfully merging a pull request may close this issue.