← All tasks
javascriptTypeStrong/ts-loader #839Not a task: not reproduced

TypeScript should be a peerdependency

envgap__TypeStrong__ts-loader-839

01 / FAILURE SIGNATURE

As reported upstream

No identifying execution failure has been captured.
Not a benchmark task.
  • In a clean container the reported failure did not reproduce, or the known fix did not make the project run.

02 / ENVIRONMENT RECIPE

Base commit
fa844af333cf4ec66278bb3b9af06a190bca06ce
Manifest
package.json
Reproduce
Awaiting issue-specific recipe
Run under trace
Awaiting a meaningful runtime command

03 / ORIGINAL ISSUE TEXT

TypeStrong/ts-loader #839 · read the original issue
### Expected Behaviour



`ts-loader` shouldn't rely on undefined behaviors



### Actual Behaviour



`ts-loader` currently relies on the hoisting in order to have access to the `typescript` package



The fix is pretty simple: `typescript` just has to be listed as a `peerDependencies` of `ts-loader` (rather than just a `devDependencies`). This will guarantee that it will then get the exact same instance than its parent. It can be listed as both if you want to also install it by default on dev environments.



### Steps to Reproduce the Problem



It causes issues with package trees that do not support hoisting, such as Yarn Plug'n'Play.



### Location of a Minimal Repository that Demonstrates the Issue.



Because Plug'n'Play has a fallback mechanism, hitting this case is a bit more difficult to reproduce - but basically, if you have a workspace that depends on both `ts-loader` and `typescript`, it won't work (because `ts-loader` won't be allowed to access `typescript` as it's not one of its dependencies, and because the fallback won't kick in since `typescript` will be in a workspace rather than the top-level module).
Continue on GitHub ↗

04 / LABELS

Labels from the report text only; not yet run

No supported category has been assigned.

Label rules and the text that matched
[]