Closed matthewrobb closed 10 years ago
this normally happen when you have a linked pkg that contains recast as a dep, while you have another recast dep that does the parsing. Even if the version of the recast pkgs are the same, it seems to be a problem with the way recast compare references. Nothing to do with the transpiler IMO.
@caridy I did a bit more digging based on what you said and I found that the problem stems from the fact that recast depends on a different esprima than the version es6-module-transpiler depends on. If I adjust recast to have the same dependency then it works, otherwise not.
It might be valuable to put some documentation up somewhere that in order to use es6-module-transpiler with other recast transformers you need to pass esprima into recast.parse() and it has to be git://github.com/thomasboyt/esprima#4be906f1abcbb
Alternatively, perhaps exporting esprima from es6-module-transpiler would be a good choice. Allowing people to do recast.parse(..., { esprima: require("es6-module-transpiler").esprima })
@matthewrobb Care to share some more details as to how you resolved this issue?
I believe the current plan is to standardize on using esprima-fb instead of esprima#harmony. That way npm can properly dedupe and everyone will be happy :wink:
I think we can close this one now.
Maybe this should be reopened. With v0.9.0
when using:
export * from './foo';
I'm seeing this error:
Error writing bundle in "bundle.js": Error: `export *` found at foo.js:1:1 is not supported, please use `export { … }` instead
This export-from syntax is suppose to be supported, correct?
@ericf this is tracked here: https://github.com/esnext/es6-module-transpiler/issues/29
I may be missing something but I cannot get default exports to work with the current or previous few versions of es6-module-transpiler.
Error:
When looking a little deeper it appears that the ast node used in exports.js has the default property undefined no matter what: