You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think we're getting the same issue for @sveltejs/kit. It's unclear to me if we're actually doing something wrong. If so, it would be helpful if the error message could also suggest some possible fixes as I'm not sure in what other way we should write the types.
Ambient module declarations should only be used to type imports that do not invoke a file-to-file module resolution algorithm at runtime/bundle-time, i.e., environmental built-ins like "fs" or things that a bundler/compiler will strip away no matter the location of the importing file on disk. They should not be used to type imports that will resolve (at runtime/bundle-time) by walking up node_modules. They are not a way to bundle the types for multiple runtime modules into one file like https://github.com/Rich-Harris/dts-buddy tries to do.
arethetypeswrong has a bug here and it will report the wrong (and more severe) kind of problem, but there are so few instances where it’s correct to use an ambient module declaration that it feels likely that SvelteKit is misusing them. When I fix this, I’ll write accompanying docs about the consequences of misusing ambient module declarations.
Example: https://arethetypeswrong.github.io/?p=highlight.js%4011.9.0
Using ambient modules in this way should probably be a different problem kind
The text was updated successfully, but these errors were encountered: