benjamn / recast

JavaScript syntax tree transformer, nondestructive pretty-printer, and automatic source map generator
MIT License
4.91k stars 347 forks source link

Invariant Failed - Sourcemaps #1402

Open GianlucaGuarini opened 2 months ago

GianlucaGuarini commented 2 months ago

Hi there, I am getting a recast error into the Riot.js compiler similar to this old one

I could reproduce it with this example: https://runkit.com/gianlucaguarini/recast-bug-2

It seems that the sourcemaps generation fails in some cases when the code gets wrapped into round brackets.

Any help is really appreciated, thank you!