fastify/fastify-vite

TypeError [ERR_INVALID_ARG_TYPE]: The "paths[0]" argument must be of type string

felixmosh opened this issue · 0 comments

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.24.3

Plugin version

5.0.0

Node.js version

18.7

Operating system

macOS

Operating system version (i.e. 20.04, 11.3, 10)

11.3

Description

TypeError [ERR_INVALID_ARG_TYPE]: The "paths[0]" argument must be of type string. Received undefined
at new NodeError (node:internal/errors:405:5)
at validateString (node:internal/validators:162:11)
at resolve (node:path:1097:7)
at resolveSPABundle (/Users//Projects/node//node_modules/@fastify/vite/config.js:219:18)
at configure (/Users//Projects/node//node_modules/@fastify/vite/config.js:112:24)
at async Vite.ready (/Users//Projects/node//node_modules/@fastify/vite/index.js:19:19)
at async main (file:///Users/
/Projects/node/*/dist/server/index.js:30:5) {
code: 'ERR_INVALID_ARG_TYPE'
}

Steps to Reproduce

instance.register(FastifyVite, {
    root: path.resolve(__dirname, '../../../'),
    dev: env.NODE_ENV === 'development',
    spa: true,
  })

inside vite, pass an async function to defineConfig

Expected Behavior

it should await the function