Comments (2)
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.
from arethetypeswrong.github.io.
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.
from arethetypeswrong.github.io.
Related Issues (20)
- TS 5.3 incompatibility HOT 3
- core/dist/types.d.ts contains triple-slash reference to ts-expose-internals HOT 1
- What to do for missing export = when it's TypeScript's fault (kinda) HOT 2
- Update MissingExportEquals.md for import default = fetch HOT 3
- lodash types are wrong (or lying?) HOT 6
- Specifying @types packages in the web UI is broken
- Trailing `/` exports don’t get detected as wildcards
- ERR_REQUIRE_ESM when upgrading from 0.13.6 to 0.13.8 HOT 2
- Indicate when JS is unanalyzable
- Understand basic UMD modules HOT 1
- Rule for missing default export / completely wrong exports?
- confusing resolution failure HOT 14
- Why are paths with colons unresolvable? HOT 2
- No errors for ESM module resolution, while errors are expected HOT 3
- [FEATURE]: Create a badge that says whether or not a package passes this repository's tests HOT 3
- Bug: This is too good
- Conditional exports syntax HOT 1
- Seeking NodeJS + TypeScript Demo Project with CJS and ESM Exports HOT 1
- Incorrectly passing when types missing in package exports HOT 3
- How to make this work with svelte? HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arethetypeswrong.github.io.