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

Cannot build ImportDefaultSpecifier #33

Closed
kyldvs opened this issue Aug 8, 2015 · 8 comments
Closed

Cannot build ImportDefaultSpecifier #33

kyldvs opened this issue Aug 8, 2015 · 8 comments

Comments

@kyldvs
Copy link

kyldvs commented Aug 8, 2015

It always complains about a missing id which I'm not able to provide when I try to build it with functions. Using template I can get a little bit farther and then manually set the id. Not sure if this is an error on jscodeshift or a library that is being consumed by jscodeshift, but since I can repro in the AST explorer I'll just start by reporting here :)

http://felix-kling.de/esprima_ast_explorer/#/odivoefENV/1

@fkling
Copy link
Contributor

fkling commented Aug 10, 2015

Regarding printing: benjamn/recast/pull/209
Regarding building: have to investigate more

@benjamn
Copy link

benjamn commented Aug 10, 2015

Possibly related: benjamn/recast#206

@fkling
Copy link
Contributor

fkling commented Aug 10, 2015

^ Ah, thank you. I haven seen that issue before :)

@cpojer
Copy link
Contributor

cpojer commented Aug 12, 2015

This seems to have been resolved in recast?

@cpojer cpojer closed this as completed Aug 12, 2015
@fkling
Copy link
Contributor

fkling commented Aug 12, 2015

Printing yes, but not building (I think).

@cpojer
Copy link
Contributor

cpojer commented Aug 12, 2015

@benjamn does building work yet?

@benjamn
Copy link

benjamn commented Aug 14, 2015

euphocat pushed a commit to euphocat/jscodeshift that referenced this issue Oct 22, 2017
Also simplifies the logic. I originally based it off https://github.com/yannickcr/eslint-plugin-react/blob/master/lib/rules/sort-comp.js, but it doesn't need to be nearly as complex because it doesn't have to give useful error output.
euphocat pushed a commit to euphocat/jscodeshift that referenced this issue Oct 22, 2017
take method ordering in sort-comp as an option
@jedwards1211
Copy link
Contributor

jedwards1211 commented Oct 6, 2020

@benjamn I'm getting a similar error with with exportSpecifier in [email protected]/[email protected].

Was there a breaking change in recent releases of ast-types?

andy@Andys-MacBook-Pro-2:jscodeshift-find-imports (master) $ node
Welcome to Node.js v12.16.0.
Type ".help" for more information.
> var j = require('jscodeshift')
undefined
> j.exportSpecifier(j.identifier('foo'), j.identifier('bar'))
Uncaught:
Error: no value or default function given for field "exported" of ExportSpecifier("id": Identifier | null, "name": Identifier | null)
    at addParam (/Users/andy/codemodsquad/jscodeshift-find-imports/node_modules/jscodeshift/node_modules/ast-types/lib/types.js:443:27)
    at /Users/andy/codemodsquad/jscodeshift-find-imports/node_modules/jscodeshift/node_modules/ast-types/lib/types.js:477:21
    at Array.forEach (<anonymous>)
    at Function.builder [as exportSpecifier] (/Users/andy/codemodsquad/jscodeshift-find-imports/node_modules/jscodeshift/node_modules/ast-types/lib/types.js:475:46)
> 
andy@Andys-MacBook-Pro-2:jscodeshift-find-imports (master) $ npm ls recast
[email protected] /Users/andy/codemodsquad/jscodeshift-find-imports
└─┬ [email protected]
  └── [email protected] 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants