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 i tried to setup local library with yarn workspaces, i've found out that this library doesn't work inside configuration file vite.config.ts - everything is fine until you try to start dev server - it throws error
failed to load config from /home/projects/vitejs-vite-lpsoay/vite.config.ts
error when starting dev server:
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts"for /home/projects/vitejs-vite-lpsoay/tools/index.ts
at __node_internal_ (https://vitejsvitelpsoay-wusl.w-credentialless.staticblitz.com/blitz.6f234770.js:36:5406)
at new <anonymous> (https://vitejsvitelpsoay-wusl.w-credentialless.staticblitz.com/blitz.6f234770.js:36:4168)
at file: (https://vitejsvitelpsoay-wusl.w-credentialless.staticblitz.com/blitz.6f234770.js:150:1250)
at defaultGetFormat (https://vitejsvitelpsoay-wusl.w-credentialless.staticblitz.com/blitz.6f234770.js:150:1573)
at defaultLoad (https://vitejsvitelpsoay-wusl.w-credentialless.staticblitz.com/blitz.6f234770.js:254:833)
at nextLoad (https://vitejsvitelpsoay-wusl.w-credentialless.staticblitz.com/blitz.6f234770.js:248:2120)
at ESMLoader.load (https://vitejsvitelpsoay-wusl.w-credentialless.staticblitz.com/blitz.6f234770.js:248:5485)
at ESMLoader.<anonymous> (https://vitejsvitelpsoay-wusl.w-credentialless.staticblitz.com/blitz.6f234770.js:248:8230)
at new ModuleJob (https://vitejsvitelpsoay-wusl.w-credentialless.staticblitz.com/blitz.6f234770.js:181:767)
at ESMLoader._createModuleJob2 (https://vitejsvitelpsoay-wusl.w-credentialless.staticblitz.com/blitz.6f234770.js:248:8151)
at ESMLoader.getModuleJob (https://vitejsvitelpsoay-wusl.w-credentialless.staticblitz.com/blitz.6f234770.js:248:4644)
at async https://vitejsvitelpsoay-wusl.w-credentialless.staticblitz.com/blitz.6f234770.js:181:966
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
Related to #13332
When i tried to setup local library with yarn workspaces, i've found out that this library doesn't work inside configuration file vite.config.ts - everything is fine until you try to start dev server - it throws error
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts"
Thats is problem, because i need shared configuration logic between projects in monorepo.
Actually, you still can use relative import for this library. For example, if you have local workspace library
@foo/tools
Reproduction
https://stackblitz.com/edit/vitejs-vite-lpsoay?file=main.js
Steps to reproduce
Just open the reproduction link - it automatically throws reported error (or start the dev server by
yarn dev
manually)System Info
System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 18.18.0 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 10.2.3 - /usr/local/bin/npm pnpm: 8.14.0 - /usr/local/bin/pnpm npmPackages: vite: ^5.1.4 => 5.1.4
Used Package Manager
yarn
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: