Microbundle: [TS] Generators not working

Created on 18 Feb 2019  路  12Comments  路  Source: developit/microbundle

It seems that (at least in my Typescript project), Generators are not correctly transpiled before buble, which does not support generators.

(buble plugin) CompileError: Generators are not supported (12:2)

bug enhancement help wanted

Most helpful comment

We'll want to handle these in Babel. This actually might require dropping Bubl茅 entirely. Depending on browser support, there's a pretty strong case for leaving generators untranspiled - IE11 is the only browser folks worry about that doesn't support them.

All 12 comments

We'll want to handle these in Babel. This actually might require dropping Bubl茅 entirely. Depending on browser support, there's a pretty strong case for leaving generators untranspiled - IE11 is the only browser folks worry about that doesn't support them.

Do we support generators now?

want to build module with redux-saga...

I would really like to ship a library with generators untranspiled. @developit Is there any way that I can pass options to bubl茅?

Generators appear to work with microbundle@next, but I can't seem to ship them untranspiled :/

No error is thrown when bundling code containing async generators.

Also if you have an async generator inside a class, its this reference is broken (points to Window). Could be my fault, but the code I was trying to bundle works fine unbundled (example repl).

Running into this problem too. But it doesn't seem to be fixed in microbundle@next

(buble plugin) CompileError: Transforming generators is not implemented. Usetransforms: { generator: false }to skip transformation and disable this error. (237:33)

This is happening in a third party module so I can't even opt to not use a generator in this case.

@MarkLyck that error is from microbundle@latest?

@ForsakenHarmony Yeah both in @latest and @next as far as I can tell.

We don't have buble in @next, are you sure you don't use a global install or something?

Any updates on this? @developit

Hi @MarkLyck !

Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you're able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it.

If you're up for it, we'd very much appreciate if you could provide a minimal reproduction and we'll be able to take another look.

We've a generator test https://github.com/developit/microbundle/tree/master/test/fixtures/modern-generators, I might not grasp the whole issue here.

Gonna close this for now, leave a comment if it's still an issue with v0.12

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rzkhosroshahi picture rzkhosroshahi  路  5Comments

developerdizzle picture developerdizzle  路  5Comments

retyui picture retyui  路  4Comments

jlkiri picture jlkiri  路  4Comments

adriengibrat picture adriengibrat  路  4Comments