Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined #5

Open
FluffyDiscord opened this issue Aug 1, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@FluffyDiscord
Copy link

Hi, would you consider adding Vite support ?

19:52:32 [vite] vite.config.js changed, restarting server...
error when starting dev server:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at new NodeError (node:internal/errors:372:5)
    at validateString (node:internal/validators:120:11)
    at Object.isAbsolute (node:path:403:5)
    at new Generator (C:\wamp64\www\msd2\node_modules\svelte-dts\dist\generator.js:50:37)
    at Context.<anonymous> (C:\wamp64\www\msd2\node_modules\svelte-dts\dist\svelteDts.js:23:29)
    at Generator.next (<anonymous>)
    at C:\wamp64\www\msd2\node_modules\svelte-dts\dist\svelteDts.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (C:\wamp64\www\msd2\node_modules\svelte-dts\dist\svelteDts.js:4:12)
    at Context.buildStart (C:\wamp64\www\msd2\node_modules\svelte-dts\dist\svelteDts.js:22:20)
error Command failed with exit code 1.

package.json

{
"devDependencies": {
    "@types/bootstrap": "^5.1.12",
    "@types/nprogress": "^0.2.0",
    "tailwindcss": "^3.1.6",
    "vite": "^3",
    "vite-define-envs-plugin": "^0.1.1",
    "vite-plugin-symfony": "^0.3.1"
  },
  "dependencies": {
    "@inertiajs/inertia": "^0.11.0",
    "@inertiajs/inertia-svelte": "^0.8.0",
    "@inertiajs/progress": "^0.2.7",
    "@sveltejs/vite-plugin-svelte": "^1.0.1",
    "autoprefixer": "^10.4.7",
    "axios": "^0.27.2",
    "gsap": "^3.10.4",
    "nouislider": "^15.6.0",
    "nprogress": "^0.2.0",
    "path": "^0.12.7",
    "postcss": "^8.4.14",
    "postcss-scss": "^4.0.4",
    "sass": "^1.54.0",
    "svelte": "^3.49.0",
    "svelte-content-loader": "^1.1.3",
    "svelte-dts": "^0.3.7",
    "svelte-motion": "^0.11.2",
    "svelte-preprocess": "^4.10.7",
    "svelte-previous": "^2.1.1",
    "swr": "^1.3.0",
    "typescript": "^4.7.4"
  },
}

vite.config.js

import { defineConfig } from "vite"
import symfonyPlugin from "vite-plugin-symfony"
import { svelte } from '@sveltejs/vite-plugin-svelte'
import sveltePreprocess from 'svelte-preprocess'
import svelteDts from 'svelte-dts'
import dns from 'dns'

dns.setDefaultResultOrder('verbatim')

export default defineConfig({
    plugins: [
        symfonyPlugin(),
        svelteDts(),
        svelte({
            preprocess: [sveltePreprocess({ typescript: true })],
            experimental: {
                prebundleSvelteLibraries: true,
            },
            hot: {
                // preserveLocalState: true,
            }
        }),
    ],
    server: {
        host: "127.0.0.1",
        hmr: true
    },
    root: ".",
    base: "/build/",
    build: {
        manifest: true,
        emptyOutDir: true,
        assetsDir: "",
        outDir: "./public/build",
        rollupOptions: {
            input: {
                app: "./assets/App/app.js",
                presentation: "./assets/presentation/presentation.ts",
            },
        },
    },
    resolve: {
        dedupe: ["axios", "svelte-motion", "framer-motion", "gsap", "nouislider"],
    },
});
@andrelmlins
Copy link
Owner

Yes, it would be interesting to have this support, are you interested in bringing this improvement?

@andrelmlins andrelmlins added the enhancement New feature or request label Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants