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

Where to put custom_typings for server? #189

Open
kasbah opened this issue Mar 7, 2022 · 3 comments
Open

Where to put custom_typings for server? #189

kasbah opened this issue Mar 7, 2022 · 3 comments

Comments

@kasbah
Copy link
Contributor

kasbah commented Mar 7, 2022

I'm trying to add some typings for an untyped module in the server. (@sabaki/deadstones, here's the branch where it's failing)

error TS7016: Could not find a declaration file for module '@sabaki/deadstones'.
  1. Tried adding server/custom_typings/@sabaki/deadstones.d.ts
  2. Tried copying the folder to server/.hathora/custom_typings
  3. Tried adding "typeRoots": ["./node_modules/@types", "./custom_typings"] to server/tsconfig.json
  4. Tried setting "strict": false in server/tsconfig.json (it doesn't actually even seem to propagate to server/.hathora/tsconfig.json?)

Nothing seems to be working. Still fairly new to Typescript so may be missing something.

@hpx7
Copy link
Member

hpx7 commented Mar 7, 2022

Try adding this to impl.ts:

/// <reference types="./custom_typings/@sabaki/deadstones" />

I got that from TypeStrong/ts-node#782 (comment)

@kasbah
Copy link
Contributor Author

kasbah commented Mar 13, 2022

Thanks for the suggestion. I just tried it but it gives the same error. I also modified templates/base/server/.hathora/tsconfig.json.hbs with:

  1. adding "typeRoots": ["./node_modules/@types", "../custom_typings"], which didn't have any effect.
  2. setting "strict": false there, which does work but means I'm giving up strict typing of course.

@kasbah
Copy link
Contributor Author

kasbah commented Mar 13, 2022

Hold on! I needed to move it to the top: kasbah/calm-go@311f7ee

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

2 participants