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

Bug: fails when /api isn't defined #40

Open
kopach opened this issue May 8, 2023 · 2 comments
Open

Bug: fails when /api isn't defined #40

kopach opened this issue May 8, 2023 · 2 comments

Comments

@kopach
Copy link

kopach commented May 8, 2023

I have a simple project with no API. When this plugin added I'm getting this error

no such file or directory, lstat '<project-path>/pages/api`

As a workaround – I've just created api/index.ts

@kopach
Copy link
Author

kopach commented May 10, 2023

seems like fixed long time ago but not released to NPM

@kopach
Copy link
Author

kopach commented May 10, 2023

Anyway, bug found in this "unreleased" version. When there is no /api folder TypeSafeApiRoute is not created but still referenced in typeSafeUrl which causes TS to do not work.

it should be done like this

  export type TypeSafeApiRoute = never;

or TypeSafeApiRoute should not be mentioned at all

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

1 participant