rescript declares @rescript/runtime, but with pnpm the runtime is only installed in the virtual store, not exposed as a direct app dependency.
Minimal repro:
mkdir repro-runtime
cd repro-runtime
pnpm init
pnpm add rescript
node -p "require('./node_modules/rescript/package.json').dependencies['@rescript/runtime']"
test -d node_modules/@rescript/runtime && echo present || echo missing
node -p "require.resolve('@rescript/runtime/package.json')"
Actual result:
- rescript declares @rescript/runtime
- node_modules/@rescript/runtime is missing
- require.resolve('@rescript/runtime/package.json') fails from the app root
But the package does exist in .pnpm, so it is installed transitively.
This means app-owned compiled JS importing @rescript/runtime/... fails unless the app also adds @rescript/runtime directly.
Question:
- Is this expected with pnpm?
- If yes, should the docs explicitly say ReScript apps using strict package isolation should add @rescript/runtime directly?
rescript declares @rescript/runtime, but with pnpm the runtime is only installed in the virtual store, not exposed as a direct app dependency.
Minimal repro:
mkdir repro-runtime
cd repro-runtime
pnpm init
pnpm add rescript
node -p "require('./node_modules/rescript/package.json').dependencies['@rescript/runtime']"
test -d node_modules/@rescript/runtime && echo present || echo missing
node -p "require.resolve('@rescript/runtime/package.json')"
Actual result:
But the package does exist in .pnpm, so it is installed transitively.
This means app-owned compiled JS importing @rescript/runtime/... fails unless the app also adds @rescript/runtime directly.
Question: