fastify / fastify-vite

Fastify plugin for Vite integration.
MIT License
849 stars 71 forks source link

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

Closed felixmosh closed 9 months ago

felixmosh commented 9 months ago

Prerequisites

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