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
If your tsconfig extends multiple other tsconfigs, the build / dev server crashes with the error: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Array.
This is useful when your in a monorepo with shared compiler options while also extending ./.svelte-kit/tsconfig.json in on of the apps
This feature is introduced in Typescript 5.0
I'll try to fix this in a PR, If I fail I'll comment
The dev server should error out by itself, if it doesn't try npm run build
Logs
> vite build
error during build:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Array
at new NodeError (node:internal/errors:399:5)
at validateString (node:internal/validators:163:11)
at Object.resolve (node:path:1102:7)
at validate_user_config (file:///home/jeremy/dev/Web/Tagaro-Web/node_modules/.pnpm/@sveltejs+kit@1.11.0_svelte@3.56.0+vite@4.1.4/node_modules/@sveltejs/kit/src/core/sync/write_tsconfig.js:179:50)
at write_tsconfig (file:///home/jeremy/dev/Web/Tagaro-Web/node_modules/.pnpm/@sveltejs+kit@1.11.0_svelte@3.56.0+vite@4.1.4/node_modules/@sveltejs/kit/src/core/sync/write_tsconfig.js:45:19)
at init (file:///home/jeremy/dev/Web/Tagaro-Web/node_modules/.pnpm/@sveltejs+kit@1.11.0_svelte@3.56.0+vite@4.1.4/node_modules/@sveltejs/kit/src/core/sync/sync.js:16:2)
at Module.all (file:///home/jeremy/dev/Web/Tagaro-Web/node_modules/.pnpm/@sveltejs+kit@1.11.0_svelte@3.56.0+vite@4.1.4/node_modules/@sveltejs/kit/src/core/sync/sync.js:57:2)
at config (file:///home/jeremy/dev/Web/Tagaro-Web/node_modules/.pnpm/@sveltejs+kit@1.11.0_svelte@3.56.0+vite@4.1.4/node_modules/@sveltejs/kit/src/exports/vite/index.js:291:34)
at runConfigHook (file:///home/jeremy/dev/Web/Tagaro-Web/node_modules/.pnpm/vite@4.1.4/node_modules/vite/dist/node/chunks/dep-ca21228b.js:62375:31)
at async resolveConfig (file:///home/jeremy/dev/Web/Tagaro-Web/node_modules/.pnpm/vite@4.1.4/node_modules/vite/dist/node/chunks/dep-ca21228b.js:61876:14)
ELIFECYCLE Command failed with exit code 1.
functionvalidate_user_config(kit,cwd,out,config){// we need to check that the user's tsconfig extends the framework configconstextend=config.options.extends;constextends_framework_config=extend&&path.resolve(cwd,extend)===out;// ...
JeremyMoeglich
changed the title
Support tsconfig extending multiple tsconfigs
Support tsconfig extending multiple tsconfigs, typescript 5.0
Mar 12, 2023
Describe the bug
If your tsconfig extends multiple other tsconfigs, the build / dev server crashes with the error: TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received an instance of Array.
This is useful when your in a monorepo with shared compiler options while also extending ./.svelte-kit/tsconfig.json in on of the apps
This feature is introduced in Typescript 5.0
I'll try to fix this in a PR, If I fail I'll comment
Reproduction
https://stackblitz.com/edit/sveltejs-kit-template-default-zk7trz?file=tsconfig.json
The dev server should error out by itself, if it doesn't try
npm run build
Logs
System Info
Severity
serious, but I can work around it
Additional Information
The source of this error seems to be
located in https://github.com/sveltejs/kit/blob/master/packages/kit/src/core/sync/write_tsconfig.js
The text was updated successfully, but these errors were encountered: