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

New watch option does not report errors #712

Closed
montogeek opened this issue Jun 10, 2016 · 2 comments Β· Fixed by #714
Closed

New watch option does not report errors #712

montogeek opened this issue Jun 10, 2016 · 2 comments Β· Fixed by #714

Comments

@montogeek
Copy link

montogeek commented Jun 10, 2016

Hi!

When using the new watch flag (-w) it does not report bundling errors, such as Unexpected token and similars.

When running without the -w flag it does report errors.

Example:

montogeek ~/foo/bar [03:27 PM]β†’ πŸ˜›  (dev)
πŸ‘‰  rollup -c rollup.config.umd.js -w
checking rollup-watch version...
bundling...
montogeek ~/foo/bar [03:31 PM]β†’ πŸ˜›  (dev)
πŸ‘‰  rollup -c rollup.config.umd.js
Error loading /Users/montogeek/foo/bar/src/services/creditcard.js: /Users/montogeek/foo/bar/src/services/creditcard.js: Unexpected token (11:2)
SyntaxError: /Users/montogeek/foo/bar/src/services/creditcard.js: Unexpected token (11:2)
   9 |   CREDIT_CARD_EXPIRY_INVALID,
  10 |   CREDIT_CARD_CVC_INVALID
> 11 | } '../errorCodes';
     |   ^
  12 | import { config } from '../config';
  13 |
  14 | // API Endpoint
    at Parser.pp.raise (/Users/montogeek/foo/bar/node_modules/babylon/lib/parser/location.js:22:13)
    at Parser.pp.unexpected (/Users/montogeek/foo/bar/node_modules/babylon/lib/parser/util.js:89:8)
    at Parser.pp.expectContextual (/Users/montogeek/foo/bar/node_modules/babylon/lib/parser/util.js:57:39)
    at Parser.pp.parseImport (/Users/montogeek/foo/bar/node_modules/babylon/lib/parser/statement.js:1004:10)
    at Parser.pp.parseStatement (/Users/montogeek/foo/bar/node_modules/babylon/lib/parser/statement.js:141:56)
    at Parser.parseStatement (/Users/montogeek/foo/bar/node_modules/babylon/lib/plugins/flow.js:30:22)
    at Parser.pp.parseBlockBody (/Users/montogeek/foo/bar/node_modules/babylon/lib/parser/statement.js:529:21)
    at Parser.pp.parseTopLevel (/Users/montogeek/foo/bar/node_modules/babylon/lib/parser/statement.js:36:8)
    at Parser.parse (/Users/montogeek/foo/bar/node_modules/babylon/lib/parser/index.js:129:19)
    at parse (/Users/montogeek/foo/bar/node_modules/babylon/lib/index.js:47:47)
Type rollup --help for help, or visit https://github.com/rollup/rollup/wiki

File config:
rollup.config.js

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

const config = {
  entry: 'src/index.js',
  plugins: [
    babel({
      babelrc: false,
      presets: ['es2015-rollup'],
      plugins: ['transform-flow-strip-types', 'transform-object-rest-spread', 'transform-class-properties'],
      exclude: 'node_modules/**'
    }),
    commonjs({
      include: 'node_modules/**',
      namedExports: {
        'node_modules/moment/moment.js': ['moment']
      }
    }),
    nodeResolve({
      jsnext: true,
      browser: true,
      preferBuiltins: false
    })
  ]
}

export default config;

rollup.config.umd.js

import config from './rollup.config';

config.format = 'umd';
config.dest = 'dist/project.umd.js';
config.moduleName = 'foo';
config.sourceMap = true;

export default config;
@montogeek montogeek changed the title New option watch not reporting errors New watch option does not reporting errors Jun 10, 2016
@montogeek montogeek changed the title New watch option does not reporting errors New watch option does not report errors Jun 10, 2016
@Rich-Harris
Copy link
Contributor

Thanks – have released rollup-watch@2.2.0 with the first half of a fix for this – it will now emit an error event and recover. Now just need prettier logging

@montogeek
Copy link
Author

Thanks @Rich-Harris

Rich-Harris added a commit that referenced this issue Jun 11, 2016
handle errors emitted by rollup-watch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants