-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
compile errors when typechecking svelte.config.js
with moduleResolution
set to nodenext
#619
Comments
When you run |
i'm deliberately typechecking the
digging into it further, it seems to be caused by the since svelte projects have // foo.js
export const foo = 1 // svelte.config.js
import { foo } from './foo' // will fail at runtime because es modules need the .js file extension the fix is to change these imports from |
I mean the jsconfig, not the svelte config. Running
I guess that's true but as you mentioned it's because But also, libraries can use types however they want, they have their own config and preferences. I don't think it's fair to assert your preference into other libraries, that's a reason I push towards |
oh right i see what you mean. that was intentional too for my minimal repro, the jsconfig wasn't needed since i was passing the relevant arguments to
yeah this seems to be an issue with lots of packages. imo it just makes the ecosystem with node and typescript's ES modules support even more confusing for users since pretty much every package i've come across seems to not be configured to support them properly.
yeah i get that many compiler options are personal preference. like i wouldn't assert my preference for the in this case, the packages in question are ES modules (as defined in the
contrary to popular belief, when packages are configured correctly, differences in strictness options rarely cause compile errors to surface in third party code (at least in my experience). this is because usually only their declaration files ( |
Describe the bug
when typechecking
svelte.config.js
withmoduleResolution
set tonodenext
, the following compile errors occur:this is also an issue in several other packages. see:
svelte.config.js
withmoduleResolution
set tonodenext
kit#9663svelte.config.js
withmoduleResolution
set tonodenext
svelte-preprocess#591Reproduction URL
https://stackblitz.com/edit/vitejs-vite-rnb6gs?file=package.json
Reproduction
dev
npm script to finish runningvite
package)Logs
No response
System Info
The text was updated successfully, but these errors were encountered: