-
Notifications
You must be signed in to change notification settings - Fork 348
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
ES6 import/export declaration building fails #206
Comments
It seems that if i comment out the line "require("./def/babel");" in node_modules/ast-types/main.js the code works as it used to and the import declarations are properly generated. |
The same issue and error occurs also for: |
Commenting out Longer-term, I want to make it easier to instantiate In the meantime, I'm still trying to come up with a good temporary solution. |
This is a temporary workaround for benjamn/recast#206 until something along the lines of #57 is implemented.
Ok, I think this should be fixed by benjamn/ast-types@a4cd3e9, which is part of |
I'm hitting this issue when using the When evaluating
|
This is a temporary workaround for benjamn/recast#206 until something along the lines of benjamn/ast-types#57 is implemented.
This is a temporary workaround for benjamn/recast#206 until something along the lines of benjamn/ast-types#57 is implemented.
This is a temporary workaround for benjamn/recast#206 until something along the lines of benjamn/ast-types#57 is implemented.
I have the following declaration and I'm trying to create a simple ES6 import:
astBuilder.importDeclaration(
[astBuilder.importSpecifier( astBuilder.identifier("test"), astBuilder.identifier("test") )], astBuilder.literal(modulePath)
);
However, this fails with:
AssertionError: no value or default function given for field "id" of ImportSpecifier("imported": Identifier, "local": Identifier)
at add node_modules/ast-types/lib/types.js:541:28)
at node_modules/ast-types/lib/types.js:563:17
at Array.forEach (native)
at Object.defineProperty.value as importSpecifier
Tried also similar approaches with importDefaultSpecifier but got the same result.
This used to work without any issues in previous versions of recast.
I'm using the latest version published on NPM for recast
The text was updated successfully, but these errors were encountered: