Skip to content

pnpm add rescript is not enough to make @rescript/runtime resolvable from the app #8357

@JonoPrest

Description

@JonoPrest

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?

Metadata

Metadata

Assignees

No one assigned

    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