pocketbase / pocketbase

Open Source realtime backend in 1 file
https://pocketbase.io
MIT License
39.21k stars 1.81k forks source link

Type error after starting pocketbase #3627

Closed Laecherlich closed 11 months ago

Laecherlich commented 11 months ago

Hey, after running the serve command the types.d.tsfile is created. This file has a type error in line 17706. Can someone please have a look and if necessary fix it?

Screenshot 2023-10-28 at 13 45 55

ganigeorgiev commented 11 months ago

I'll consider updating the generated types with the next release, but this file is not required for PocketBase to work and you can ignore it.

Laecherlich commented 11 months ago

Okay thanks :) I am using a TypedPocketBase and when building the compiler complained, that the generated types have an error.

ganigeorgiev commented 11 months ago

I don't know what TypedPocketBase is but the above file is intended to be used only by your editors LSP when working with JS pb_hooks and when referenced manually in your hook file as shown in https://pocketbase.io/docs/js-overview/#typescript-declarations-and-code-completion.

Laecherlich commented 11 months ago

I meant this from the js-skd

TypedPocketBase

ganigeorgiev commented 11 months ago

Again, the above file has no relation to the JS SDK or your own custom types. It is used only as ambient TS declarations for the JS pb_hooks.

If for some reason your TS config is complaining about it, you can try to exclude it (probably you have a wildcard pattern somewhere defined that will traverse all directories to look for .ts/.d.ts files).

Laecherlich commented 11 months ago

Yes excluding the file worked, thanks

ganigeorgiev commented 11 months ago

The generated TS file was updated in master and will be available with the next minor release sometime later next week.

But again, the above file can be safely ignored since it is just a helper to provide ambient TS declarations (eg. autocomplete, docs on hover, etc.) when PocketBase is used as framework with the JS pb_hooks.