Next.js Discord

Discord Forum

Uncache Modules

Unanswered
Siamese posted this in #help-forum
Open in Discord
SiameseOP
I currently host react components as an external module on my localhost3000. In my NextJS app, I am retrieving these modules using the experiment urlImports and dynamic imports.

const OverlayMiddleware = dynamic(() =>
 import('http://localhost:3000/template.js'),
  {
    ssr: false,
    loading: () => 
      <div>Loading Template...</div>
  }
)


It seems, however, that this import is cached. Whenever I make a change to the template.js module, this change is not reflected in my app. I.e. due to the module being cached; any changes to the template.js file is not being saved to my application.

0 Replies