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

zodError when running workshop #237

Closed
philberryman opened this issue Oct 8, 2024 · 12 comments
Closed

zodError when running workshop #237

philberryman opened this issue Oct 8, 2024 · 12 comments

Comments

@philberryman
Copy link

I also get this on React Fundamentals that's been running for the last few days, but I just tried to restart.

🐨  Let's get learning!
Local:            http://localhost:5639
On Your Network:  http://192.168.0.20:5639
Press Ctrl+C to stop
ZodError: [
  {
    "code": "invalid_type",
    "expected": "object",
    "received": "null",
    "path": [
      "discordProfile"
    ],
    "message": "Expected object, received null"
  }
]
    at Object.get error [as error] (file:///Users/phil/workspace/epic-react/react-hooks/epicshop/node_modules/zod/lib/index.mjs:587:31)
    at ZodEffects.parse (file:///Users/phil/workspace/epic-react/react-hooks/epicshop/node_modules/zod/lib/index.mjs:692:22)
    at getFreshValue (file:///Users/phil/workspace/epic-react/react-hooks/epicshop/node_modules/@epic-web/workshop-app/app/utils/epic-api.ts:638:26)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at getFreshValue (file:///Users/phil/workspace/epic-react/react-hooks/epicshop/node_modules/@epic-web/cachified/src/getFreshValue.ts:17:24)
    at Module.cachified (file:///Users/phil/workspace/epic-react/react-hooks/epicshop/node_modules/@epic-web/cachified/src/cachified.ts:89:17)
    at file:///Users/phil/workspace/epic-react/react-hooks/epicshop/node_modules/remix-utils/build/common/promise.js:30:106
    at async Promise.all (index 3)
    at promiseHash (file:///Users/phil/workspace/epic-react/react-hooks/epicshop/node_modules/remix-utils/build/common/promise.js:30:31)
    at loader$y (file:///Users/phil/workspace/epic-react/react-hooks/epicshop/node_modules/@epic-web/workshop-app/app/root.tsx:106:21) {
  issues: [
    {
      code: 'invalid_type',
      expected: 'object',
      received: 'null',
      path: [Array],
      message: 'Expected object, received null'
    }
  ],
  addIssue: [Function (anonymous)],
  addIssues: [Function (anonymous)],
  errors: [
    {
      code: 'invalid_type',
      expected: 'object',
      received: 'null',
      path: [Array],
      message: 'Expected object, received null'
    }
  ]
}
@kentcdodds
Copy link
Member

My bad. Just released a bad validation. Pushing a fix in a moment.

@kentcdodds
Copy link
Member

This should be fixed now! Sorry for the hiccup!

@philberryman
Copy link
Author

I'm still seeing it unfortunately.

The package.json in the epic-shop folder is still referencing 5.3.1 - https://github.com/epicweb-dev/react-hooks/blob/main/epicshop/package.json

  "dependencies": {
    "@epic-web/workshop-app": "^5.3.1",
    "@epic-web/workshop-utils": "^5.3.1",
    "execa": "^9.1.0"
  }

But even after updating this to 5.3.2 , deleting node_modules, package-lock and clearing npm cache, I still have the same issue. I've also tried cloning another workshop and see the same.

@facuperezm
Copy link
Contributor

I am still seeing a similar issue

npm start

> start
> npx --prefix ./epicshop epicshop start

🐨  Let's get learning!
Local:            http://localhost:5639
On Your Network:  http://192.168.1.79:5639
Press Ctrl+C to stop
ZodError: [
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "null",
    "path": [
      "discordProfile",
      "nick"
    ],
    "message": "Expected string, received null"
  }
]
    at Object.get error [as error] (file:///Users/facuperezm/Documents/personal-projects/epic-react-course/react-hooks/epicshop/node_modules/zod/lib/index.mjs:587:31)
    at ZodEffects.parse (file:///Users/facuperezm/Documents/personal-projects/epic-react-course/react-hooks/epicshop/node_modules/zod/lib/index.mjs:692:22)
    at getFreshValue (file:///Users/facuperezm/Documents/personal-projects/epic-react-course/react-hooks/epicshop/node_modules/@epic-web/workshop-app/app/utils/epic-api.ts:640:26)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at getFreshValue (file:///Users/facuperezm/Documents/personal-projects/epic-react-course/react-hooks/epicshop/node_modules/@epic-web/cachified/src/getFreshValue.ts:17:24)
    at Module.cachified (file:///Users/facuperezm/Documents/personal-projects/epic-react-course/react-hooks/epicshop/node_modules/@epic-web/cachified/src/cachified.ts:89:17)
    at file:///Users/facuperezm/Documents/personal-projects/epic-react-course/react-hooks/epicshop/node_modules/remix-utils/build/common/promise.js:30:106
    at async Promise.all (index 3)
    at promiseHash (file:///Users/facuperezm/Documents/personal-projects/epic-react-course/react-hooks/epicshop/node_modules/remix-utils/build/common/promise.js:30:31)
    at loader$y (file:///Users/facuperezm/Documents/personal-projects/epic-react-course/react-hooks/epicshop/node_modules/@epic-web/workshop-app/app/root.tsx:106:21) {
  issues: [
    {
      code: 'invalid_type',
      expected: 'string',
      received: 'null',
      path: [Array],
      message: 'Expected string, received null'
    }
  ],
  addIssue: [Function (anonymous)],
  addIssues: [Function (anonymous)],
  errors: [
    {
      code: 'invalid_type',
      expected: 'string',
      received: 'null',
      path: [Array],
      message: 'Expected string, received null'
    }
  ]
}

And this is what I see when I go to localhost
Screenshot 2024-10-08 at 16 13 30

@kentcdodds
Copy link
Member

🤦‍♂️ Forgot to run the update on the workshops for the second fix.

Thanks for your patience. Running that now.

@kentcdodds
Copy link
Member

Fixed!

@facuperezm
Copy link
Contributor

Sorry Kent, but it is still not working for me, I ran the update, also deleted the whole repo locally, and installed everything fresh and the error is still there :/

npm start

> start
> npx --prefix ./epicshop epicshop start

🐨  Let's get learning!
Local:            http://localhost:5639
On Your Network:  http://192.168.1.79:5639
Press Ctrl+C to stop
ZodError: [
  {
    "code": "invalid_type",
    "expected": "string",
    "received": "null",
    "path": [
      "discordProfile",
      "nick"
    ],
    "message": "Expected string, received null"
  }
]
    at Object.get error [as error] (file:///Users/facuperezm/Documents/personal-projects/epic-react-course/react-hooks/epicshop/node_modules/zod/lib/index.mjs:587:31)
    at ZodEffects.parse (file:///Users/facuperezm/Documents/personal-projects/epic-react-course/react-hooks/epicshop/node_modules/zod/lib/index.mjs:692:22)
    at getFreshValue (file:///Users/facuperezm/Documents/personal-projects/epic-react-course/react-hooks/epicshop/node_modules/@epic-web/workshop-app/app/utils/epic-api.ts:638:26)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at getFreshValue (file:///Users/facuperezm/Documents/personal-projects/epic-react-course/react-hooks/epicshop/node_modules/@epic-web/cachified/src/getFreshValue.ts:17:24)
    at Module.cachified (file:///Users/facuperezm/Documents/personal-projects/epic-react-course/react-hooks/epicshop/node_modules/@epic-web/cachified/src/cachified.ts:89:17)
    at file:///Users/facuperezm/Documents/personal-projects/epic-react-course/react-hooks/epicshop/node_modules/remix-utils/build/common/promise.js:30:106
    at async Promise.all (index 3)
    at promiseHash (file:///Users/facuperezm/Documents/personal-projects/epic-react-course/react-hooks/epicshop/node_modules/remix-utils/build/common/promise.js:30:31)
    at loader$y (file:///Users/facuperezm/Documents/personal-projects/epic-react-course/react-hooks/epicshop/node_modules/@epic-web/workshop-app/app/root.tsx:106:21) {
  issues: [
    {
      code: 'invalid_type',
      expected: 'string',
      received: 'null',
      path: [Array],
      message: 'Expected string, received null'
    }
  ],
  addIssue: [Function (anonymous)],
  addIssues: [Function (anonymous)],
  errors: [
    {
      code: 'invalid_type',
      expected: 'string',
      received: 'null',
      path: [Array],
      message: 'Expected string, received null'
    }
  ]
}

@philberryman
Copy link
Author

Same - happy to jump on a discord chat or whatever if that helps to debug whatever some of us are seeing

@kentcdodds
Copy link
Member

Sorry about this! It should definitely be fixed now!

@facuperezm
Copy link
Contributor

Thanks Kent!

@philberryman
Copy link
Author

image

Thanks Kent!

@kentcdodds
Copy link
Member

Haha, thanks @philberryman 😆 Thank you for your patience!

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

3 participants