Closed isaacs closed 2 years ago
Thanks for the report, I'm looking into this shortly.
Does it still happen in production mode? node NODE_ENV=production app.js
I'm afraid Vite's development server might not work in HTTPS mode.
@galvez That results in this error:
$ NODE_ENV=production node app.js
Error: Missing production client/index.html — did you build first?
at recalcDist (/Users/isaacs/dev/tierdev/tierweb-vue/node_modules/fastify-vite/options.js:91:15)
at processOptions (/Users/isaacs/dev/tierdev/tierweb-vue/node_modules/fastify-vite/options.js:100:3)
at fastifyVite (/Users/isaacs/dev/tierdev/tierweb-vue/node_modules/fastify-vite/index.js:32:21)
at Plugin.exec (/Users/isaacs/dev/tierdev/tierweb-vue/node_modules/avvio/plugin.js:132:19)
at Boot.loadPlugin (/Users/isaacs/dev/tierdev/tierweb-vue/node_modules/avvio/plugin.js:274:10)
Yes, because to run in production mode first you have to build the app bundle: node app.js build
.
In development mode the bundle is generated automatically for development.
Sorry, NODE_ENV=production node app.js build
.
$ NODE_ENV=production node app.js build
Error: Missing production client/index.html — did you build first?
at recalcDist (/Users/isaacs/dev/tierdev/tierweb-vue/node_modules/fastify-vite/options.js:91:15)
at processOptions (/Users/isaacs/dev/tierdev/tierweb-vue/node_modules/fastify-vite/options.js:100:3)
at fastifyVite (/Users/isaacs/dev/tierdev/tierweb-vue/node_modules/fastify-vite/index.js:32:21)
at Plugin.exec (/Users/isaacs/dev/tierdev/tierweb-vue/node_modules/avvio/plugin.js:132:19)
at Boot.loadPlugin (/Users/isaacs/dev/tierdev/tierweb-vue/node_modules/avvio/plugin.js:274:10)
Hey @isaacs please refer to the new README which covers the upcoming v3 release in detail.
Prerequisites
Fastify version
3.28.0
Plugin version
2.3.1
Node.js version
17.6.0
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
21.4.0
Description
Following steps at: https://fastify-vite.dev/quickstart/vue.html result in an infinite reload loop. No idea why.
Steps to Reproduce
node app.js
Resulting logs: https://gist.github.com/b3934ff57a86a5cb6b51616ddce2b4c3
Expected Behavior
Should load content once, not infinitely many times as fast as possible.