dune icon indicating copy to clipboard operation
dune copied to clipboard

Melange: moving modules inside a library with include_subdirs leads to broken paths

Open jchavarri opened this issue 2 years ago • 1 comments
trafficstars

Expected Behavior

Inside a library using include_subdirs unqualified, a module X can be moved from one folder to another, with Dune re-running melc on the dependents of X so that their paths to JS imports can be updated.

Actual Behavior

Moving the module X leaves the dependents untouched, so any bundler like Webpack or Esbuild will fail because the import path to X these dependents are using still points to the old folder path.

Reproduction

  • PR with a reproducing test: #9189.

jchavarri avatar Nov 15 '23 14:11 jchavarri

For the record, we observed this behavior is quite tricky to work around once one runs into it, because it's not only necessary to run dune clean, but also remove the Dune cache if it is enabled, in order for the new paths to be picked up.

jchavarri avatar Jan 30 '24 11:01 jchavarri