blitz-js / legacy-framework

MIT License
3 stars 2 forks source link

Route error after running "generate all" #398

Closed chrisj-back2work closed 2 years ago

chrisj-back2work commented 2 years ago

What is the problem?

After a successful blitz generate all admin/Tag run, there is a server error:

TypeError: _blitzjs_core__WEBPACK_IMPORTED_MODULE_2__.Routes.NewTagPage is not a function

Paste all your error logs here:

TypeError: _blitzjs_core__WEBPACK_IMPORTED_MODULE_2__.Routes.NewTagPage is not a function

Paste all relevant code snippets here:

The files created by the generate operation were:

new file:   app/admin/tags/components/TagForm.tsx
new file:   app/admin/tags/mutations/createTag.ts
new file:   app/admin/tags/mutations/deleteTag.ts
new file:   app/admin/tags/mutations/updateTag.ts
new file:   app/admin/tags/queries/getTag.ts
new file:   app/admin/tags/queries/getTags.ts
new file:   app/pages/tags/[tagId].tsx
new file:   app/pages/tags/[tagId]/edit.tsx
new file:   app/pages/tags/index.tsx
new file:   app/pages/tags/new.tsx
new file:   db/migrations/20211108062847_/migration.sql
new file:   db/migrations/migration_lock.toml

The NewTagPage route is referenced in app/pages/tags/new.tsx only.

What are detailed steps to reproduce this?

  1. Apply model to DB via blitz prisma db push
  2. Start the local server via blitz dev
  3. Browse to http://localhost:3000/tags

Run blitz -v and paste the output here:

macOS Monterey | darwin-x64 | Node: v16.9.1

blitz: 0.41.1 (global)
blitz: 0.41.1 (local)

  Package manager: yarn
  System:
    OS: macOS 12.0.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 20.06 MB / 32.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 16.9.1 - ~/.asdf/installs/nodejs/16.9.1/bin/node
    Yarn: 1.22.17 - ~/.asdf/installs/yarn/1.22.17/bin/yarn
    npm: 7.21.1 - ~/.asdf/plugins/nodejs/shims/npm
    Watchman: Not Found
  npmPackages:
    @prisma/client: 3.3.0 => 3.3.0
    blitz: 0.41.1 => 0.41.1
    prisma: 3.3.0 => 3.3.0
    react: alpha => 18.0.0-alpha-6bce0355c-20211031
    react-dom: alpha => 18.0.0-alpha-6bce0355c-20211031
    typescript: ~4.3 => 4.3.5

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

No response

beerose commented 2 years ago

Related issue: https://github.com/blitz-js/legacy-framework/issues/222.

Can you try running blitz codegen and let us know if that helps?

beerose commented 2 years ago

It might have been fixed in the latest releases. Could you try and let us know if the issue persists?

beerose commented 2 years ago

Closing due to inactivity. Please reopen or open a new issue if this happens again with the latest Blitz version.