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

Missing declaration for files that are importing svelte components #403

Open
3 tasks done
7H3LaughingMan opened this issue Dec 26, 2024 · 0 comments
Open
3 tasks done

Comments

@7H3LaughingMan
Copy link

Describe the bug

I am working on a project that is a type declaration package for a Foundry VTT game system so that others can use the package to develop modules for the game system. This plugin used to work in generating the type declaration without many issues, but as of late it's not and is having issues with certain files that are now using svelte. I am not getting any errors and changing to different log levels doesn't seem to provide any information as to why the plugin isn't working.

I have included the link to the specific files that are having issues getting a type declaration generated.

https://github.com/foundryvtt/pf2e/blob/master/src/module/apps/compendium-browser/browser.ts
https://github.com/foundryvtt/pf2e/blob/master/src/module/actor/character/apps/abc-picker/app.ts
https://github.com/foundryvtt/pf2e/blob/master/src/module/actor/character/apps/formula-picker/app.ts

Reproduction

https://github.com/foundryvtt/pf2e

Steps to reproduce

  1. Clone the pf2e repository
  2. Install vite-plugin-dts
  3. Edit vite.config.ts
    • Add import dts from "vite-plugin-dts";
    • Change const plugins = [checker({ typescript: true }), tsconfigPaths({ loose: true }), sveltePlugin()]; to const plugins = [checker({ typescript: true }), tsconfigPaths({ loose: true }), sveltePlugin(), dts()];
  4. Run the command npx vite build
  5. Observe that there is no ./dist/src/module/apps/compendium-browser/browser.d.ts

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
    Memory: 3.25 GB / 15.85 GB
  Binaries:
    Node: 20.15.1 - ~\AppData\Local\nvs\default\node.EXE
    Yarn: 1.22.22 - ~\AppData\Local\nvs\default\yarn.CMD
    npm: 10.9.1 - ~\AppData\Local\nvs\default\npm.CMD
    pnpm: 9.15.1 - ~\AppData\Local\nvs\default\pnpm.CMD
  Browsers:
    Edge: Chromium (131.0.2903.99)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    vite: ^5.4.11 => 5.4.11

Validations

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