src/components
: Is fast refresh / reload supported?
#14381
Answered
by
theogravity
theogravity
asked this question in
Help
-
I've moved most of my stuff into the
Anything I need to do to get this to work?
my startup script:
calls a custom server: import express, { Request, Response } from 'express'
import next from 'next'
import { requestContextMiddleware } from './controllers/req-context-middleware'
import { handleErrorMiddleware } from './controllers/handle-err-middleware'
const dev = process.env.NODE_ENV !== 'production'
const nextApp = next({ dev })
const handle = nextApp.getRequestHandler()
const port = process.env.PORT || 3000
export async function initApp () {
try {
await nextApp.prepare()
const server = express()
server.use(requestContextMiddleware())
server.all('*', (req: Request, res: Response) => {
return handle(req, res)
})
server.use(handleErrorMiddleware())
server.listen(port, (err?: any) => {
if (err) throw err
console.log(`> Ready on localhost:${port} - env ${process.env.NODE_ENV}`)
})
} catch (e) {
console.error(e)
process.exit(1)
}
} The component I'm modifying is pretty simple:
There is nothing in the console or terminal that indicates it has detected a change. |
Beta Was this translation helpful? Give feedback.
Answered by
theogravity
Jun 20, 2020
Replies: 1 comment
-
I read somewhere that deleting your And what do you know... it works now. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
theogravity
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I read somewhere that deleting your
node_modules
dir andyarn.lock
file and reinstalling fixes the issue.And what do you know... it works now.