Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin error during initial pass stops watch #3215

Closed
gordonmleigh opened this issue Nov 7, 2019 · 3 comments · Fixed by #3219
Closed

Plugin error during initial pass stops watch #3215

gordonmleigh opened this issue Nov 7, 2019 · 3 comments · Fixed by #3219

Comments

@gordonmleigh
Copy link

gordonmleigh commented Nov 7, 2019

  • Rollup Version: 1.26.3
  • Operating System (or Browser): OS X 10.14
  • Node Version: 12.11.1

How Do We Reproduce?

Files

index.js:

func tion foo() {} // note space

rollup.config.js:

import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';

export default {
  input: './index.js',
  output: [
    {
      file: 'lib/bundle.js',
      format: 'cjs',
      sourcemap: true,
    },
  ],

  plugins: [resolve(), commonjs()],
};

Steps

  1. Run rollup -c -w
  2. Fix syntax error in js file and save

Expected Behaviour

The build should fail, but then run again when the file is fixed.

Actual Behavior

Error is shown on first build:

rollup v1.26.3
bundles ./index.js → lib/bundle.js...
[!] (plugin commonjs) SyntaxError: Unexpected token (1:4) in /../rollup-watch-repro/index.js
index.js (1:4)
1: fun ction foo() {}
       ^
SyntaxError: Unexpected token (1:4) in /../rollup-watch-repro/index.js

After save, nothing happens. Note that this problem only happens if there is a plugin error (if the commonjs plugin is removed, then the file is rebundled as expected).

Related issues

Following issues have no repros but are related: #3172, #2534

@petterek
Copy link

petterek commented Nov 7, 2019

In my case where I have multiple entry points / files this also happens if I have some syntax error in the ts files after while "watching"

@lukastaegert
Copy link
Member

Thanks for spotting the relation to plugin errors, fix upcoming.

@lukastaegert
Copy link
Member

Fix at #3219

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants