Skip to content

fix migrate svelte configuration from TypeScript to JavaScript#1

Open
sinanatra wants to merge 1 commit into
mainfrom
file-extension-fix
Open

fix migrate svelte configuration from TypeScript to JavaScript#1
sinanatra wants to merge 1 commit into
mainfrom
file-extension-fix

Conversation

@sinanatra

@sinanatra sinanatra commented Mar 31, 2026

Copy link
Copy Markdown
Member

When i try to setup the project i get:

PM [vite-plugin-svelte] failed to import config /Users/giacomonanni/Documents/Development/vantage/svelte.config.ts
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/giacomonanni/Documents/Development/vantage/svelte.config.ts
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:218:9)
    at defaultGetFormat (node:internal/modules/esm/get_format:244:36)
    at defaultLoad (node:internal/modules/esm/load:122:22)
    at async nextLoad (node:internal/modules/esm/hooks:748:22)
    at async Hooks.load (node:internal/modules/esm/hooks:385:20)
    at async MessagePort.handleMessage (node:internal/modules/esm/worker:199:18) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
error when starting dev server:
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/giacomonanni/Documents/Development/vantage/svelte.config.ts
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:218:9)
    at defaultGetFormat (node:internal/modules/esm/get_format:244:36)
    at defaultLoad (node:internal/modules/esm/load:122:22)
    at async nextLoad (node:internal/modules/esm/hooks:748:22)
    at async Hooks.load (node:internal/modules/esm/hooks:385:20)
    at async MessagePort.handleMessage (node:internal/modules/esm/worker:199:18) {
  code: 'ERR_UNKNOWN_FILE_EXTENSION'
}

If i rename the config to .js, everything works

@fidelthomet

Copy link
Copy Markdown
Member

Can't reproduce the problem. Which command is throwing this error? What node / npm versions are you using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants