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

Switch order of parameters for CompileError constructor #24

Merged
merged 2 commits into from
Nov 3, 2017

Conversation

IvanSanchez
Copy link
Contributor

I've been hitting a problem in a rollup (v0.50) + buble (v0.16) workflow: Error messages from buble are replaced with something more cryptic:

TypeError: Cannot read property 'magicString' of undefined
    at new CompileError (/.../node_modules/buble/dist/buble.umd.js:1131:29)

As it turns out, rollup is calling the CompileError constructor on its own, to decorate Errors coming from rollup plugins. But it calls the constructor with only message as its first argument, triggering the aforementioned TypeError:

image

I feel that the easiest workaround is to patch buble's CompileError constructor to be more alike the Error constructor.

@Rich-Harris
Copy link
Collaborator

Ugh. This seems like a larger failure of design. But the fix seems reasonable for now — thanks

@Rich-Harris Rich-Harris merged commit fbbe65e into bublejs:master Nov 3, 2017
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 this pull request may close these issues.

None yet

2 participants