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

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

Open
glenn-vandeputte opened this issue Nov 29, 2024 · 1 comment
Open

Comments

@glenn-vandeputte
Copy link

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
@mansona
Copy link
Member

mansona commented Nov 29, 2024

does it work if you're not using typescript?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants