fastify / fastify-vite

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

Unable to specify any base route other than '/' #152

Closed onlywei closed 3 months ago

onlywei commented 3 months ago

Prerequisites

Fastify version

4.26.2

Plugin version

6.0.6

Node.js version

20.13.1

Operating system

macOS

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

14.4.1

Description

Trying to build a boilerplate with this project using TypeScript. Ran into quite a few issues, but worked through most of them. Now am stuck on this strange issue.

To see the issue, please clone the github repo. Once cloned, simply execute:

npm run build
npm run start:prod

Note that the server starts, but as soon as you open a browser targeting localhost:3000/your-base/, there is a 404 trying to load the "/your-base/assets/index-DSIhbpTP.js" file.

Link to code that reproduces the bug

https://github.com/onlywei/fastify-vite-typescript-boilerplate

Expected Behavior

There should be no 404 error.

onlywei commented 3 months ago

This issue is not present if / is used as the vite base config.