#monorepo 3 articles
- A component from a linked package throws "Invalid hook call" in Jest — the test loaded a second copy of Reactgotchas / toolingJest resolves a file:/junction package by its real path, so the package's require('react') finds a second copy; map react and react-dom to the app's copy (the SPFx build is unaffected — React is a platform component)
- A shared package's dynamic import() ships inlined (not lazy-chunked) under module:commonjsgotchas / spfxA linked TS package built with module:commonjs turns import() into require(), so webpack can't lazy-chunk the lib into a separate file; set the package's module:esnext
- Compiled files sitting next to sources fake your build verificationgotchas / toolingStale .js/.d.ts in src/ greps like live code while main points at lib/; ask require.resolve, date-check with git log, and keep the ignore rule narrow enough to spare hand-written .d.ts