Comments (3)
I'm afraid I've never used mongoose, so I don't think I can really help here.
There must be some state somewhere that mongoose is keeping around. You might be better off asking on the mongoose support channels.
from ultimate-hot-reloading-example.
Ok, I suspected the answer :)
Thanks anyway!
from ultimate-hot-reloading-example.
Ok i found the solution. I post it in case someone would be concerned.
It is necessary to reset the mongoose models with mongoose.models = {}
:
watcher.on('ready', function() {
watcher.on('all', function() {
console.log('Clearing /server/ module cache from server')
mongoose.models = {} /*Reset mongoose models*/
Object.keys(require.cache).forEach(function(id) {
if (/[\/\\]server[\/\\]/.test(id)) delete require.cache[id]
})
})
})
++
from ultimate-hot-reloading-example.
Related Issues (20)
- Has any example about many components and pages? HOT 2
- PostCSS Not Being Used? HOT 3
- server reload can not work on windows HOT 6
- Mysterious babel error HOT 6
- Flash of style on start up HOT 6
- Express routes not reloading HOT 7
- Working on Koa2? HOT 6
- Is this deprecated? HOT 2
- Issue when converting to ES6 Module syntax HOT 5
- Sass live reload? HOT 1
- Consider isomorphic-webpack
- This isn't hot reloading. This is going to the browser and refreshing HOT 1
- How we can use this trick with sass files? HOT 1
- Example with Webpack 2.X
- Integrate VSCode debugging for both client and server side
- npm run start fails on Debian 9
- Figure out exactly what file has been changed instead of clear all cache HOT 2
- Cannot "hot-reload" for the server side/express related stuffs
- Webpack 4?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ultimate-hot-reloading-example.