Skip to content

Commit 4bdbca6

Browse files
committed
docs: note pnpm hoisting caveat for @rescript/runtime
pnpm's strict isolation does not expose transitive dependencies at the app root, so ReScript-compiled JS importing @rescript/runtime fails to resolve. Add a callout to the installation and v12 migration docs explaining the two workarounds (direct install or publicHoistPattern in pnpm-workspace.yaml) and fix a small typo while at it.
1 parent 105b8ed commit 4bdbca6

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

markdown-pages/docs/manual/installation.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,15 @@ bun create rescript-app
133133

134134
</CodeTab>
135135

136+
<Info>
137+
**pnpm users:** ReScript-compiled JS imports from `@rescript/runtime` directly, but pnpm's strict isolation does not expose transitive dependencies at the app root. Either install the runtime as a direct dependency (`pnpm add @rescript/runtime`), or hoist it by adding the following to `pnpm-workspace.yaml`:
138+
139+
```yaml
140+
publicHoistPattern:
141+
- "*@rescript/runtime*"
142+
```
143+
</Info>
144+
136145
- Create a ReScript build configuration file (called `rescript.json`) at the root:
137146
```json
138147
{

markdown-pages/docs/manual/migrate-to-v12.mdx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,17 @@ if you had `@rescript/std` installed, remove it as well:
5151
npm uninstall @rescript/std
5252
```
5353

54-
this is replaced by `@rescript/runtime`, which is a installed as a dependency of `rescript` now.
54+
this is replaced by `@rescript/runtime`, which is installed as a dependency of `rescript` now.
55+
56+
<Info>
57+
**pnpm users:** since pnpm does not hoist transitive dependencies, you may need to install `@rescript/runtime` as a direct dependency (`pnpm add @rescript/runtime`), or hoist it by adding the following to `pnpm-workspace.yaml`:
58+
59+
```yaml
60+
publicHoistPattern:
61+
- "*@rescript/runtime*"
62+
```
63+
64+
</Info>
5565
5666
## Replacements
5767

0 commit comments

Comments
 (0)