Skip to content

Compiler error on initial install #76

@cburgmer

Description

@cburgmer

I might be doing it wrong, but following the steps layed out in http://www.angularplayground.it/docs/getting-started/angular-cli I yield the following when running npm run playground:

[ng serve]:
ERROR in /my_project/src/sandboxes.ts (14,14): Expression expected.
ERROR in /my_project/src/sandboxes.ts (14,20): Unreachable code detected.
ERROR in /my_project/src/sandboxes.ts (14,88): Property 'then' does not exist on type '"./app/my-widget/my-widget.component.sandbox"'.

The file in src/sandboxes.ts looks like

export function getSandboxMenuItems() {
  return [{
    'key': './app/my-widget/my-widget.component.sandbox',
    'searchKey': 'MyWidgetComponent',
    'name': 'MyWidgetComponent',
    'label': '',
    'scenarioMenuItems': [{'key': 1, 'description': 'with simple text'}]
  }];
}

export function getSandbox(path: string) {
  switch (path) {
    case './app/my-widget/my-widget.component.sandbox':
      return import('./app/my-widget/my-widget.component.sandbox').then(sandbox => { return sandbox.default.serialize('./app/my-widget/my-widget.component.sandbox'); });
  }
}

I did change the module to esnext in src/tsconfig.app.json.

Versions:

$ cat package-lock.json | grep @angular/cli
    "@angular/cli": {
      "resolved": "https://registry.npmjs.org//@angular/cli/-/cli-1.5.0.tgz",
$ cat package-lock.json | grep angular-playground
    "angular-playground": {
      "resolved": "https://registry.npmjs.org/angular-playground/-/angular-playground-3.0.0.tgz",

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