Skip to content

Route generation fails when there is an if condition in the file #237

Description

@glenn-vandeputte

I have

Router.map(function () {

  if (macroCondition(getOwnConfig<OwnBuildConfig>().styleGuideIncluded)) {
    this.route('style-guide');
  }
  })

to conditionally add a route based on config.
When I now run ember generate route new-route the generation fails. (I'm guessing on the if condition as unrecognized token?)

➜ ember generate route test-route
installing route
create app/routes/test-route.ts
create app/templates/test-route.hbs
Unexpected token (25:50)


Stack Trace and Error Report: /var/folders/9n/3zhdhb8959j9y02w5yc05zxc0000gn/T/error.dump.398d37c04279098c44d50061a23a6941.log

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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