Missing dependency in search path when using dynamic import
As soon as I use Js.import() I get this error:
Missing dependency X in search path.
where X is Js.import(X.make) (following the lazy component docs).
Full minimal repro here: https://github.com/benadamstyles/rescript-js-import-repro.
Short forum discussion here.
Observation: The issue seems related to that there are 2 package specs. If you remove the bottom one (the one without in-source: true) then it works fine.
Seems to be the exact combination of one with and one without in-source: true that's causing the issue. No other combination triggers it for me.
EDIT: v12 and Rewatch has the same issue.
@benadamstyles could you clarify why you have that combination in package-specs?
Oh nice catch, thanks. We need this combination because we use one codebase to generate both a Vite-based web app, and a Node/Express server. The former needs in-source for various reasons, and the latter needs to go into the lib folder for easy packaging/dockerizing.
Just to update you, we rejigged our build process to remove the second package-spec, and now the error is gone 🎉 Might still be worth fixing though for future users?