Plugins: Watching broken in TypeScript 4.1.2 and newer (including latest version 5.x+)

Created on 29 Jun 2020  ·  5Comments  ·  Source: rollup/plugins

Overview

This regression is almost certainly caused by https://github.com/rollup/plugins/pull/352. That's the only real commit in 4.1.2 and things work with 4.1.1. Furthermore that puts createWatchProgram in an if statement.

This issue has been reported by a few different users of the Sapper web framework (also created by Rich Harris) over the past few days https://github.com/sveltejs/sapper/issues/1293

Environment

  • Rollup Plugin Name: @rollup/plugin-typescript
  • Rollup Plugin Version: 4.1.2
  • Rollup Version: 2.18.0
  • Operating System (or Browser): Ubuntu
  • Node Version: v12.16.3

How Do We Reproduce?

Reproduction repo

Steps:

  1. Clone and install
  2. Run npm run dev
  3. Make a GET request, such as by visiting in the browser, /fails and see the result 1
  4. Modify src/routes/fails.ts and change 1 to 2. The change will be picked up and "rebuild"
  5. Do 3 again but still see 1 instead of the new 2

Expected Behavior

The page should change

Actual Behavior

The page doesn't change

c³ ⋅ PR welcome t⁴ ⋅ regression 🔌 plugin-typescript

All 5 comments

Also can reproduce on

  • Rollup Plugin Name: @rollup/plugin-typescript
  • Rollup Plugin Version: 5.0.1
  • Rollup Version: 2.18.1
  • System (or Browser): macOS 10.15.5
  • Node v14.4.0

425 was released with 5.0.0 and supposed to fix this (and #418), but it would appear not.

It's possible that when #449 is completed and merged that this will be solved (?)

_Fwiw we don't typically triage plugin issues on versions that are a full major behind_

We're happy to review PRs that address the issue.

This is also broken in the latest release

@benmccann a quick fix could be to add process.env.ROLLUP_WATCH = true right before the rollup.watch inside the sapper RollupCompiler watch hook. But it might be better to wait for the PR

Here's the PR that will fix this: https://github.com/rollup/plugins/pull/449

Was this page helpful?
0 / 5 - 0 ratings