Closed v3nt closed 1 year ago
Would you provide a reproduction? 🙏
Hi. We can't reproduce it locally. Only on Dev. Any files I can add here that will help?
I'm confused, because you said that "the filename changes with each build / deployment". I was assuming that this issue is present in production, but you're saying you can only reproduce in development?
Hey @danielroe I got a reproduction of this here https://github.com/nuxt/nuxt/discussions/19978
using NODE_ENV set to production stops the reloading, but we want to deploy this in development environment and NODE_ENV is set to development
Are you running nuxt build
with NODE_ENV
set to development?
Yeah it's set to development for our development build,
found something, npm start
command is calling the file server/index.ts
const express = require('express');
const consola = require('consola');
require('dotenv').config();
const { Nuxt, Builder } = require('nuxt');
const appConsole = express();
// Import and Set Nuxt.js options
const config = require('../nuxt.config.ts');
config.dev = process.env.NODE_ENV !== 'production';
async function start() {
// Init Nuxt.js
const nuxt = new Nuxt({
...config,
env: {
baseURL: process.env.baseURL,
googleAnalytics: process.env.googleAnalytics,
flagBaseUrl: process.env.flagBaseUrl,
ADMIN_MODE: process.env.ADMIN_MODE,
},
});
const { host, port } = nuxt.options.server;
await nuxt.ready();
// Build only in dev mode
if (config.dev) {
const builder = new Builder(nuxt);
await builder.build();
}
// Give nuxt middleware to express
appConsole.use(nuxt.render);
// Listen the server
appConsole.listen(port, host);
consola.ready({
message: `Server listening on https://${host}:${port}, environment:: ${process.env.NODE_ENV} baseURL:: ${process.env.baseURL}, googleAnalytics:: ${process.env.googleAnalytics}, YAPILY_UNLEASH_ENDPOINT:${process.env.YAPILY_UNLEASH_ENDPOINT}, ADMIN_MODE:${process.env.ADMIN_MODE} `,
badge: true,
});
}
start();
This file somehow started causing the issue I changed the start command to nuxt start
and it stopped reloading.
But in production build is using the same file and not reloading the page, also this is not happening locally if I run build and start command
nuxt@2.16.1
Environment
kx yapily-ui-dashboard-698f774889-bgxdj sh /src $ npx nuxi info npx: installed 1 in 1.85s Nuxi 3.2.3 10:17:58 10:17:59 RootDir: /src 10:17:59 Nuxt project info: 10:17:59
Linux
v14.21.1
2.16.1
-
npm@6.14.17
webpack
ssr
,head
,css
,buildModules
,env
,publicRuntimeConfig
,plugins
,modules
,styleResources
,telemetry
,router
,serverMiddleware
,build
,watchers
@nuxtjs/style-resources@1.2.1
,cookie-universal-nuxt@2.2.2
,nuxt-user-agent@1.2.2
Build Modules:
@nuxt/typescript-build@2.1.0
,@nuxtjs/composition-api/module@0.29.3
,@nuxtjs/dotenv@1.4.1
Reproduction
Every deployment now.
npm run build
Describe the bug
Basically can't find this file
/_nuxt/171b24e9608b53bc36dd.hot-update.json
The filename changes with each build / deployment but it always seems to be this file
/_nuxt/ x.hot-update.json
Additional context
(App is behind a VPN so can't provide access)
Logs
No response