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

Package chalk avoids starting the app #8212

Closed
GregOnNet opened this issue Oct 27, 2017 · 2 comments
Closed

Package chalk avoids starting the app #8212

GregOnNet opened this issue Oct 27, 2017 · 2 comments
Assignees
Labels
P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful type: bug/fix

Comments

@GregOnNet
Copy link

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

Angular CLI: 1.5.0-rc.5
Node: 6.11.1
OS: win32 x64
Angular: 5.0.0-rc.7
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cdk: 2.0.0-beta.12
@angular/cli: 1.5.0-rc.5
@angular/material: 2.0.0-beta.12
@angular-devkit/build-optimizer: 0.0.31
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.34
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.0-rc.5
@schematics/angular: 0.0.48
typescript: 2.5.3
webpack: 3.8.1

Repro steps.

You will find the project containing the configuration in the following repository: ngrx-aware

$ rm -rf node_modules
$ yarn install 
$ yarn start

The log given by the failure.

Inside type_checker.js an error is thrown.

Cannot read property 'constructor' of undefined
TypeError: Cannot read property 'constructor' of undefined
    at Object.<anonymous> (C:\workbench\scratch\ngrx-aware\node_modules\@ngtools\webpack\src\type_checker.js:14:37)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\workbench\scratch\ngrx-aware\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:18:24)
    at Module._compile (module.js:570:32)

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\nodejs\\node.exe" "C:\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.11.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! ngrx-aware@0.0.0 start: `ng serve`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ngrx-aware@0.0.0 start script 'ng serve'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ngrx-aware package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ng serve
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ngrx-aware
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls ngrx-aware
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\workbench\scratch\ngrx-aware\npm-debug.log

Desired functionality.

  • no error starting the application

Mention any other details that might be useful.

  • The error is related to chalk
  • For me chalk is installed with verison 1.1.3
  • In type_checker.js the following call is made
// before
const chalkCtx = new chalk_1.default.constructor(chalk_1.default.supportsColor ? {} : { level: 1 });
// --------------------------^---------------------------^
  • chalk_1 has no property default
  • logging chalk_1 results in the following output
    { [Function]
      constructor: [Function: Chalk],
      supportsColor: { level: 1, hasBasic: true, has256: false, has16m: false } }
    
  • constructor and supportsColor can be used by removing default
// after
const chalkCtx = new chalk_1.constructor(chalk_1.supportsColor ? {} : { level: 1 });
  • Doing this get the CLI working again
filipesilva added a commit to filipesilva/angular-cli that referenced this issue Oct 27, 2017
@filipesilva filipesilva self-assigned this Oct 27, 2017
@filipesilva filipesilva added P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful type: bug/fix labels Oct 27, 2017
@clydin
Copy link
Member

clydin commented Oct 27, 2017

The CLI (v1.5.0-rc.5) has a dependency on chalk ~2.2.0 (see package.json here).

@hansl hansl closed this as completed in 32861cf Oct 27, 2017
hansl pushed a commit that referenced this issue Oct 28, 2017
asnowwolf pushed a commit to asnowwolf/angular-cli that referenced this issue Nov 2, 2017
dond2clouds pushed a commit to d2clouds/speedray-cli that referenced this issue Apr 23, 2018
@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 7, 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

No branches or pull requests

3 participants