Skip to content

viewEncapsulation is not defined #4024

Closed
@masaanli

Description

@masaanli

Please provide us with the following information:

when running ng g c masaanli it throws this error

viewEncapsulation is not defined (Error in blueprint template: /repos/masaanli/masaanli-web/node_modules/angular-cli
/blueprints/component/files/__path__/__name__.component.ts)

Problem is I cannot generate modules and components this way anymore or I need to switch back to version 24 👎

It was fixed in v 24 when I add this lines myself in the Angular CLI, but now in v 25.5 it broke...

"viewEncapsulation": "Emulated",
"changeDetection": "Default"

The error it throws now:

viewEncapsulation is not defined (Error in blueprint template: /repos/masaanli/masaanli-web/node_modules/angular-cli
/blueprints/component/files/__path__/__name__.component.ts)
ReferenceError: viewEncapsulation is not defined (Error in blueprint template: /repos/masaanli/masaanli-web/node_mod
ules/angular-cli/blueprints/component/files/__path__/__name__.component.ts)
    at eval (eval at <anonymous> (/repos/masaanli/masaanli-web/node_modules/lodash/template.js:224:12), <anonymous>:
9:5)
    at processTemplate (/repos/masaanli/masaanli-web/node_modules/angular-cli/ember-cli/lib/models/file-info.js:20:3
6)
    at /repos/masaanli/masaanli-web/node_modules/angular-cli/ember-cli/lib/models/file-info.js:97:20
    at tryCatch (/repos/masaanli/masaanli-web/node_modules/rsvp/dist/rsvp.js:538:12)
    at invokeCallback (/repos/masaanli/masaanli-web/node_modules/rsvp/dist/rsvp.js:553:13)
    at publish (/repos/masaanli/masaanli-web/node_modules/rsvp/dist/rsvp.js:521:7)
    at flush (/repos/masaanli/masaanli-web/node_modules/rsvp/dist/rsvp.js:2373:5)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)
bash-3.2$

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:
6.9.1
25.5

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

The log given by the failure.

Normally this include a stack trace and some more information.

Mention any other details that might be useful.


Thanks! We'll be in touch soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions