Skip to content

Unable to fetch updated remote module code (caching issue?) #3119

@arimus

Description

@arimus

Describe the bug

I have a host and a remote. The initial init + fetch works great, when a changes is made to the remote that host detects it with revalidate(), but a subsequent init + fetch seems to get the old code still.

Host: built with webpack, dynamic loading of module, using revalidate() to poll for changes that require an init + reload
Remote: running with webpack dev server

I'm not sure how to ensure the latest version of the code is fetched / the appropriate caches are cleared / etc.

p.s. is there no way for the host to get the HMR updates and trigger a reload off of that instead of polling or is the lack of a browser environment a deal breaker atm?

Reproduction

https://github.com/arimus/dynamic-remotes-node

Used Package Manager

npm

System Info

System:
    OS: macOS 14.4
    CPU: (10) x64 Apple M1 Pro
    Memory: 14.80 MB / 16.00 GB
    Shell: 5.2.21 - /opt/homebrew/bin/bash
  Binaries:
    Node: 20.12.0 - ~/.nvm/versions/node/v20.12.0/bin/node
    npm: 10.5.0 - ~/.nvm/versions/node/v20.12.0/bin/npm
    pnpm: 9.11.0 - ~/Library/pnpm/pnpm
    Watchman: 2024.08.05.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 130.0.6723.60
    Chrome Canary: 132.0.6795.0
    Edge: 130.0.2849.52
    Safari: 17.4
    Safari Technology Preview: 17.4

Validations

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions