blitz-js / legacy-framework

MIT License
3 stars 2 forks source link

Update graphql-apollo-server and run prisma generate #209

Closed maxall41 closed 2 years ago

maxall41 commented 2 years ago

What is the problem?

after running blitz install graphql-apollo-server and then going to http://localhost:3000/api/graphql i get Internal Server Error on the page and in the terminal i get the logs below.

Paste all your error logs here:

TypeError: Cannot read properties of undefined (reading '$name')
    at eval (webpack-internal:///./app/graphql/types/user-type.ts:12:56)
    at Object../app/graphql/types/user-type.ts (/Users/maxcampbell/Desktop/app/.next/server/pages/api/graphql.js:52:1)
    at __webpack_require__ (/Users/maxcampbell/Desktop/app/.next/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///./app/graphql/types/query-type.ts:8:68)
    at Object../app/graphql/types/query-type.ts (/Users/maxcampbell/Desktop/app/.next/server/pages/api/graphql.js:42:1)
    at __webpack_require__ (/Users/maxcampbell/Desktop/app/.next/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///./app/graphql/types/index.ts:2:69)
    at Object../app/graphql/types/index.ts (/Users/maxcampbell/Desktop/app/.next/server/pages/api/graphql.js:32:1)
    at __webpack_require__ (/Users/maxcampbell/Desktop/app/.next/server/webpack-runtime.js:33:42)
    at eval (webpack-internal:///./app/graphql/api/graphql.ts:14:64)

Paste all relevant code snippets here:

Just the default graphQL stuff

What are detailed steps to reproduce this?

  1. create new blitz project
  2. run blitz install graphql-apollo-server
  3. go to http://localhost:3000/api/graphql

Run blitz -v and paste the output here:

macOS Big Sur | darwin-arm64 | Node: v16.11.0

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

  Package manager: yarn 
  System:
    OS: macOS 11.5.2
    CPU: (8) arm64 Apple M1
    Memory: 82.70 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.11.0 - ~/.nvm/versions/node/v16.11.0/bin/node
    Yarn: 1.22.17 - /opt/homebrew/bin/yarn
    npm: 8.0.0 - ~/.nvm/versions/node/v16.11.0/bin/npm
    Watchman: Not Found
  npmPackages:
    @prisma/client: 3.4.0 => 3.4.0 
    blitz: 0.41.1 => 0.41.1 
    prisma: 3.4.0 => 3.4.0 
    react: alpha => 18.0.0-alpha-00ced1e2b-20211102 
    react-dom: alpha => 18.0.0-alpha-00ced1e2b-20211102 
    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

After installing the recipe, you have to run blitz prisma generate. It's mentioned in the template file, but we can make it more obvious. We can add it to the recipe's readme, or print a message after installing the recipe.