Open GavPierce opened 7 months ago
hmmm that sounds like a bug. what wasp version are you on? if you can share the api definition in the wasp file as well as the function its importing, that would be helpful @GavPierce
Yup this sounds super weird! @GavPierce can you share more info? Maybe a version of app that we can use to reproduce the bug?
This issue seems to be caused when an endpoint creates a new file on the server, which makes sense, but there should be the ability to turn off HMR, or HMR should not happen when a new file is created.
This issue seems to be caused when an endpoint creates a new file on the server, which makes sense, but there should be the ability to turn off HMR, or HMR should not happen when a new file is created.
Oh all right, that makes sense!
Hmmm, what could be the ideal experience here? So these files your API checkpoint is creating -> they should be under .gitignore, I am sure you don't want them versioned. I guess you do have them under .gitignore? But they are still being watched, right?
So watching in our case, for the server, is being done by nodemon
in the background.
There are multiple ways to get nodemon to ignore some files: directly by passing it flag via CLI, setting it up in package.json, or having nodemon.json file: https://stackoverflow.com/questions/41913086/nodemon-ignore-directory . I am not sure if you can actually do any of these right now via Wasp though, I think not, as nodemon is too much in the background. But we could expose a way to do it via Wasp in the future.
I updated the title to be more precise and also moved it to Wasp repo since this is not open-saas specific.
Whenever I hit a custom API in my server code in local dev, it recompiles the entire app, refreshing of course the client server page and losing all state, every time I make an API call.
This should only be happening on actual file changes, why is it happening now? And how can I turn off reloading?