wessberg / rollup-plugin-ts

A TypeScript Rollup plugin that bundles declarations, respects Browserslists, and enables seamless integration with transpilers such as babel and swc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot find module '@babel/plugin-proposal-object-rest-spread'

simonihmig opened this issue · comments

  • Version: 3.2.0
  • Rollup Version: 3.23.0
  • Operating System and version (if applicable): OSX
  • Node Version (if applicable): 18.16.0
  • Does it work with tsc (if applicable):

Reproduction

repo
failing CI

Expected Behavior

Should resolve all babel plugins that it depends on

Actual Behavior

Error: Cannot find module '@babel/plugin-proposal-object-rest-spread'

This is happening because of some sloppy dependency handling, as it tries to resolve these babel blugins without actually declaring any dependency whatsoever on them. I guess this accidentally worked because of some looseness of package managers, where some other dependency brought those in. Strangely enough that was even the case for pnpm!

This was only popping up now (when ignoring the lockfile!), presumably because those other dependencies changed something to not make those plugins resolvable anymore..

As already reported in #189 long time ago, using these plugins shouldn't actually happen at all. So I hope landing this PR will actually fix both issues!

Related: #185

Hi @simonihmig,

This has been resolved as part of v3.3.0.