blitz: blitz codegen commands cause errors if there are parenthesis in path

What is the problem?

The blitz new app generation encounters an error when trying to generate app/auth/components/LoginForm.tsx. Due to this error, I cannot create a new Blitz app.

Paste all your error logs here:

✕ Error generating app/auth/components/LoginForm.tsx
    SyntaxError: Unexpected token, expected ")" (26:24)

Paste all relevant code snippets here:

$ node -v
v17.0.1
$ yarn -v
1.22.11

What are detailed steps to reproduce this?

  1. blitz new simpleActivityTracker
  2. Install dependencies (either via npm, via yarn, or skip has no impact on the bug)
  3. Pick a form library (you can switch to something else later if you want) (either React Final Form (recommended), React Hook Form, or Formik has no impact on the bug)
  4. Receive the following error
✕ Error generating app/auth/components/LoginForm.tsx
    SyntaxError: Unexpected token, expected ")" (26:24)

Run blitz -v and paste the output here:

macOS Big Sur | darwin-x64 | Node: v17.0.1

blitz: 0.41.1 (global)

  Package manager: npm
  System:
    OS: macOS 11.6
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
    Memory: 564.47 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 17.0.1 - ~/.nvm/versions/node/v17.0.1/bin/node
    Yarn: 1.22.11 - /usr/local/bin/yarn
    npm: 8.1.0 - ~/.nvm/versions/node/v17.0.1/bin/npm
    Watchman: Not Found
  npmPackages:
    @prisma/client: Not Found
    blitz: Not Found
    prisma: Not Found
    react: Not Found
    react-dom: Not Found
    typescript: Not Found

Please include below any other applicable logs and screenshots that show your problem:

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 15 (5 by maintainers)

Most upvoted comments

Kind of narrowed it down a little.

Running via npx blitz new test works just fine. But following the getting started instructions and installing globally via yarn with yarn global add blitz and blitz new test fails for me. This is all on node 16.

Still occurs with node v16.