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

Beefy swallows useful errors #100

Open
konsumer opened this issue Dec 31, 2015 · 3 comments
Open

Beefy swallows useful errors #100

konsumer opened this issue Dec 31, 2015 · 3 comments

Comments

@konsumer
Copy link

If I run browserify, with some problematic code, I get this totally useful error message:

SyntaxError: /home/konsumer/Desktop/project/src/Game.js: Unexpected token (3:19)
  1 | import raf from 'raf'
  2 |
> 3 | import TextConsole {VGA} from './TextConsole'
    |                    ^
  4 |
  5 | export const ZInputEvent = {
  6 |   USE_TORCH: 1,
    at Parser.pp.raise (/home/konsumer/Desktop/project/node_modules/babylon/lib/parser/location.js:22:13)
    at Parser.pp.unexpected (/home/konsumer/Desktop/project/node_modules/babylon/lib/parser/util.js:91:8)
    at Parser.pp.expectContextual (/home/konsumer/Desktop/project/node_modules/babylon/lib/parser/util.js:59:39)
    at Parser.pp.parseImport (/home/konsumer/Desktop/project/node_modules/babylon/lib/parser/statement.js:968:10)
    at Parser.pp.parseStatement (/home/konsumer/Desktop/project/node_modules/babylon/lib/parser/statement.js:134:65)
    at Parser.pp.parseBlockBody (/home/konsumer/Desktop/project/node_modules/babylon/lib/parser/statement.js:500:21)
    at Parser.pp.parseTopLevel (/home/konsumer/Desktop/project/node_modules/babylon/lib/parser/statement.js:29:8)
    at Parser.parse (/home/konsumer/Desktop/project/node_modules/babylon/lib/parser/index.js:98:17)
    at Object.parse (/home/konsumer/Desktop/project/node_modules/babylon/lib/index.js:44:50)
    at File.parse (/home/konsumer/Desktop/project/node_modules/babel-core/lib/transformation/file/index.js:480:24)

The same error with beefy looks like this much less helpful error:

buffer.js:237
    buf.copy(buffer, pos);
        ^

TypeError: buf.copy is not a function
    at Function.Buffer.concat (buffer.js:237:9)
    at Stream.end (/home/konsumer/Desktop/project/node_modules/beefy/lib/accumulate-error.js:25:26)
    at _end (/home/konsumer/Desktop/project/node_modules/through/index.js:61:9)
    at Stream.stream.end (/home/konsumer/Desktop/project/node_modules/through/index.js:70:5)
    at Stream.onend (stream.js:59:10)
    at emitNone (events.js:72:20)
    at Stream.emit (events.js:166:7)
    at drain (/home/konsumer/Desktop/project/node_modules/through/index.js:33:23)
    at Stream.stream.queue.stream.push (/home/konsumer/Desktop/project/node_modules/through/index.js:41:5)
    at Stream.end (/home/konsumer/Desktop/project/node_modules/through/index.js:17:35)
@konsumer
Copy link
Author

The first error tells me that I need a comma in my import statement, the second tells me that reading some buffer failed.

@pfhayes
Copy link
Contributor

pfhayes commented Mar 3, 2016

+1 - is this expected behaviour or should there be a useful error message here?

@pfhayes
Copy link
Contributor

pfhayes commented Mar 3, 2016

I've submitted a PR here: #103

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

No branches or pull requests

2 participants