NiGhTTraX / ts-monorepo

Template for setting up a TypeScript monorepo
MIT License
1.5k stars 169 forks source link

Problems of adding Sveltekit in apps #332

Closed Jedliu closed 6 months ago

Jedliu commented 8 months ago

Hi, thank you for your contribution to this repo. It's the most elaborate pnpm monorepo I've found. The articles you wrote are very helpful.

I'm trying to add Sveltekit to the apps folder. I'd like to develop a package working for both the Nestjs and Sveltekit. I tried to call the package @nighttrax/foo in apps/sveltekit/src/routes/+page.svelte. You could find the cloned repo here.

Here are the problems I'm having:

  1. Run the dev of Sveltekit app by pnpm --filter=sveltekit dev.

  2. Without building the package @nighttrax/foo, there is an error.

Failed to resolve entry for package "@nighttrax/foo".
iShot_2024-01-25_12 57 59
  1. After building the package @nighttrax/foo, there is another error.
ReferenceError: exports TS Tot uer meu
iShot_2024-01-25_12 59 07

Would you please advise how to make it work? Thank you!

NiGhTTraX commented 7 months ago

Hey @Jedliu, I don't have any experience with Svelte, but it seems like Sveltekit has its own config for aliases https://kit.svelte.dev/docs/configuration#alias. Try duplicating the aliases from the main tsconfig there.

Jedliu commented 6 months ago

Thanks, I will look into this.