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
When attempting to publish a Svelte component library to the JSR registry, the publish process fails with the error Expected a JavaScript or TypeScript module, but identified a Unknown module. Importing these types of modules is currently not supported.
The error appears to be caused by dist/index.js containing references to .svelte files, which JSR doesn't recognize as valid module types. Is the recommended solution to transpile all .svelte files to .js before publishing? Does the Svelte compiler support this?
Several Svelte libraries are already available on JSR, but the build process for component libraries isn't clear from any of the documentations.
johndoe@Johns-MacBook-Air repl-svelte-library-jsr-publish % bunx jsr publish
Downloading JSR release binary...
[00:01] [#################################################>] 35.7 MiB/36.5 MiB
error: Expected a JavaScript or TypeScript module, but identified a Unknown module. Importing these types of modules is currently not supported.
Specifier: file:///Users/johndoe/Workspace/Dev/repl-svelte-library-jsr-publish/dist/components/Heading.svelte
at file:///Users/johndoe/Workspace/Dev/repl-svelte-library-jsr-publish/dist/index.js:1:36
Child process exited with: 1
This discussion was converted from issue #16166 on June 15, 2025 11:39.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
When attempting to publish a Svelte component library to the JSR registry, the publish process fails with the error
Expected a JavaScript or TypeScript module, but identified a Unknown module. Importing these types of modules is currently not supported.
The error appears to be caused by
dist/index.js
containing references to.svelte
files, which JSR doesn't recognize as valid module types. Is the recommended solution to transpile all.svelte
files to.js
before publishing? Does the Svelte compiler support this?Several Svelte libraries are already available on JSR, but the build process for component libraries isn't clear from any of the documentations.
Reproduction
https://github.com/kotkoroid/repl-svelte-library-jsr-publish
Logs
johndoe@Johns-MacBook-Air repl-svelte-library-jsr-publish % bunx jsr publish Downloading JSR release binary... [00:01] [#################################################>] 35.7 MiB/36.5 MiB error: Expected a JavaScript or TypeScript module, but identified a Unknown module. Importing these types of modules is currently not supported. Specifier: file:///Users/johndoe/Workspace/Dev/repl-svelte-library-jsr-publish/dist/components/Heading.svelte at file:///Users/johndoe/Workspace/Dev/repl-svelte-library-jsr-publish/dist/index.js:1:36 Child process exited with: 1
System Info
Severity
blocking all usage of svelte
Beta Was this translation helpful? Give feedback.
All reactions