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
In the svelte.config.js file, the newly added import.meta.dirname does not work.
// This worksjoin(dirname(fileURLToPath(import.meta.url)),'postcss.config.js')// This does not workjoin(import.meta.dirname,'postcss.config.js')// These two values are identicaldirname(fileURLToPath(import.meta.url))===import.meta.dirname;
The error is not shown in the svelte.config.js file.
It is only shown in Svelte files.
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
Reproduction
// svelte.config.jsimportadapterfrom'@sveltejs/adapter-node';import{vitePreprocess}from'@sveltejs/vite-plugin-svelte';import{join}from'node:path';/** @type {import('@sveltejs/kit').Config} */constconfig={// Consult https://kit.svelte.dev/docs/integrations#preprocessors// for more information about preprocessorspreprocess: vitePreprocess({style: {css: {postcss: join(import.meta.dirname,'postcss.config.js'),},},}),kit: {adapter: adapter()},};exportdefaultconfig;
Expected behaviour
Following configuration should work in Node.js v20.11+
By default, the language server is running on the version of node.js bundled with VSCode. It's 18.17.1 with VSCode 1.86.1. You can set the svelte.language-server.runtime to use another version for now but I don't think it's worth the effort since the workaround is simple enough.
Describe the bug
In the
svelte.config.js
file, the newly addedimport.meta.dirname
does not work.The error is not shown in the
svelte.config.js
file.It is only shown in Svelte files.
Reproduction
Expected behaviour
Following configuration should work in Node.js v20.11+
System Info
System:
Binaries:
npmPackages:
Which package is the issue about?
No response
Additional Information, eg. Screenshots
Node v20.11.0 (LTS)
The text was updated successfully, but these errors were encountered: