No Hot Reload on Server Side dynamic imports?
Unanswered
Gray-crowned Yellowthroat posted this in #help-forum
Gray-crowned YellowthroatOP
I'm trying to dynamically import components and assets server-side based on dynamic route parameters. It works, but there's no fast refresh/hmr when I make changes to those components. The server does recompile with those changes, but there is no update on the client.
I saw this discussion https://github.com/vercel/next.js/discussions/51016 where the conclusion was basically "just import them all statically", but that's a maintenance nightmare I'd like to avoid. My other thought is that instead of using dynamic routes those assets would each have their own route, but I'd rather be able to separate routing logic and asset management, and store those files in a way that makes more sense to the people who write them
Anybody have thoughts on how to deal with this?
I saw this discussion https://github.com/vercel/next.js/discussions/51016 where the conclusion was basically "just import them all statically", but that's a maintenance nightmare I'd like to avoid. My other thought is that instead of using dynamic routes those assets would each have their own route, but I'd rather be able to separate routing logic and asset management, and store those files in a way that makes more sense to the people who write them
Anybody have thoughts on how to deal with this?
1 Reply
Gray-crowned YellowthroatOP
The assets are markdown in an external folder, which adds its own pain points, but I've tried it with js modules inside the app and gotten the same result