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

Get Event Types parsing issue when running apps/api locally #10995

Closed
DexterStorey opened this issue Aug 28, 2023 · 4 comments
Closed

Get Event Types parsing issue when running apps/api locally #10995

DexterStorey opened this issue Aug 28, 2023 · 4 comments
Labels
api area: API, enterprise API, access token, OAuth 🐛 bug Something isn't working

Comments

@DexterStorey
Copy link
Contributor

DexterStorey commented Aug 28, 2023

Found a bug? Please fill out the sections below. 👍

Issue Summary

It is very possible that I am missing something dumb and this Issue turns out to be embarrassing haha, sorry in advance if this wastes any time!

It seems as though calls to localhost:3002/api/event-types?apiKey=API_KEY are not working locally when standing up the monorepo.

Steps to Reproduce

  1. Standup the mono repo locally
  2. Run the api app yarn dev:api
  3. Navigate to localhost:3002/api/event-types?apiKey=API_KEY
  4. You should see:
{"message":"invalid_type in 'offsetStart': Expected never, received number; invalid_type in 'parentId': Expected never, received null; invalid_type in 'requiresBookerEmailVerification': Expected never, received boolean; invalid_type in 'team': Expected never, received null; invalid_type in 'users': Expected never, received array; invalid_type in 'owner': Expected never, received object"}

Any other relevant information. For example, why do you consider this a bug and what did you expect to happen instead?

Actual Results

  • The API route GET event-types (/apps/api/pages/api/event-types/_get.ts) expects the following vars:
offsetStart
parentId
requiresBookerEmailVerification
team
users
owner

But the parser schemaEventTypeReadPublic (apps/api/lib/validations/event-type.ts)
expects those to be type never

Thus, we get an error at /api/event-types?apiKey=API_KEY

Expected Results

The parser should expect those vars OR explicitly removed OR stripped

Calls to /api/event-types?apiKey=API_KEY should return event types

Technical details

  • Running Monorepo locally with seed db, passing localhost licence key and default .env vars to api env.

Evidence

Screenshot 2023-08-28 at 4 38 20 PM

Motivation

This bug was created because this PR can't be tested properly without a fix

@maige-app maige-app bot added 🐛 bug Something isn't working api area: API, enterprise API, access token, OAuth 👩‍🔬 needs investigation labels Aug 28, 2023
@github-actions
Copy link
Contributor

Thank you for opening your first issue, one of our team members will review it as soon as it possible. ❤️🎉

DexterStorey added a commit to RubricLab/cal.com that referenced this issue Aug 28, 2023
@DexterStorey DexterStorey mentioned this issue Aug 28, 2023
2 tasks
DexterStorey added a commit to RubricLab/cal.com that referenced this issue Aug 28, 2023
@DexterStorey
Copy link
Contributor Author

Seems like it could be something to do with the seeding of App Store trying everything in #6994...

DexterStorey added a commit to RubricLab/cal.com that referenced this issue Aug 29, 2023
@DexterStorey
Copy link
Contributor Author

Looks like we tracked it down. The issue was that in the package.json of our new app, we had a different zod version. This commit fixed it: RubricLab@31aa33f

@DexterStorey
Copy link
Contributor Author

DexterStorey commented Aug 29, 2023

For anyone reading this in the future, make sure your package.json's have the right versioned deps (no conflicting versions) across the mono repo and make sure your node version is 18.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api area: API, enterprise API, access token, OAuth 🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant