I received the following error message after installing oxfmt in a repo that:
- had a vite.config.ts
- doesn't use vp nor had oxfmt configured within vite.config.ts
$ oxfmt --write:
Failed to load configuration file.
/[REDACTED]/vite.config.ts
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /[REDACTED]/vite.config.ts
Ensure the file has a valid default export of a JSON-serializable configuration object.
$ pnpm --version
10.28.1
$ node --version
v24.13.0
$ pnpm ls oxfmt
...
devDependencies:
oxfmt 0.43.0
Running pnpm exec oxfmt --init fixed the issue.
Doing the following produced a helpful message:
$ mv .oxfmtrc.json .oxfmtrc.json.disabled
$ mv vite.config.ts vite.config.ts.disabled
$ pnpm exec oxfmt tsconfig.json
Finished in 113ms on 1 files using 10 threads.
No config found, using defaults. Please add a config file or try `oxfmt --init` if needed.
While I completely understand that this is likely an edge case, I mainly wanted to submit as a bug for two reasons:
- others searching for this issue (aka my future self haha)
- the docs mention
pnpm add ..., add scripts, the pnpm run fmt as the only steps required, which to me implied that a config file wasn't necessary!
Anyway, thanks for oxfmt, I'm just starting to use it now but it seems great!
I received the following error message after installing oxfmt in a repo that:
Running
pnpm exec oxfmt --initfixed the issue.Doing the following produced a helpful message:
While I completely understand that this is likely an edge case, I mainly wanted to submit as a bug for two reasons:
pnpm add ..., add scripts, thepnpm run fmtas the only steps required, which to me implied that a config file wasn't necessary!Anyway, thanks for oxfmt, I'm just starting to use it now but it seems great!