-
Notifications
You must be signed in to change notification settings - Fork 151
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
Exported members from context=module cannot be imported into Typescript files #658
Comments
As outlined in the referenced issue, this is a type checking problem, and in your editor your can solve it by having the TypeScript plugin installed (comes by default with VS Code), and in your terminal/CI you should use |
This is not about VS Code or any other editor. This error occurs when I'm type checking/compiling my app's typescript code. I had thought |
In order to build a project containing Svelte files, you need a bundler like Vite, Rollup or Webpack configured, just using |
Hmm. I think I've been getting myself confused. My setup is only using tsc in order to type check everything, but my tests only run the Node version, so the fact that my browser code can't actually import the svelte components doesn't matter. So never mind. |
I've run into this issue: sveltejs/svelte#5817. On the main svelte repo the response was basically "not out problem". So I'm refiling it here, as I think this is the component that would have actual responsibility for this issue.
Describe the bug
I have a Svelte component which exports some constants in its
context="module"
:I want to import a constant into a regular typescript file:
When building purely with
tsc
, no bundler or anything (just with"types": ["svelte"],
in tsconfig.json) I get this error:Expected behavior
The constant can be imported into another TS file.
svelte-preprocess
version (Please check you can reproduce the issue with the latest release!)6.0.3
Nope!
The text was updated successfully, but these errors were encountered: