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

gts check leads to TypeError: Cannot read property 'getFullText' of undefined #86

Closed
JustinBeckwith opened this issue Nov 13, 2017 · 10 comments
Assignees

Comments

@JustinBeckwith
Copy link
Collaborator

beckwith-macbookpro:google-api-nodejs-client beckwith$ ls
AUTHORS             COPYING             apis                lib                 samples             test                yarn.lock
CHANGELOG.md        MIGRATING.md        coverage            node_modules        scripts             tsconfig.json
CONTRIBUTORS        README.md           jsdoc-conf.json     package.json        templates           tsconfig.tools.json
beckwith-macbookpro:google-api-nodejs-client beckwith$ gts check lib/*.ts
TypeError: Cannot read property 'getFullText' of undefined
    at /Users/beckwith/.nvm/versions/node/v8.9.1/lib/node_modules/gts/build/src/lint.js:35:55
    at Array.forEach (<anonymous>)
    at lint (/Users/beckwith/.nvm/versions/node/v8.9.1/lib/node_modules/gts/build/src/lint.js:34:14)
    at /Users/beckwith/.nvm/versions/node/v8.9.1/lib/node_modules/gts/build/src/cli.js:77:46
    at step (/Users/beckwith/.nvm/versions/node/v8.9.1/lib/node_modules/gts/build/src/cli.js:33:23)
    at Object.next (/Users/beckwith/.nvm/versions/node/v8.9.1/lib/node_modules/gts/build/src/cli.js:14:53)
    at /Users/beckwith/.nvm/versions/node/v8.9.1/lib/node_modules/gts/build/src/cli.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/beckwith/.nvm/versions/node/v8.9.1/lib/node_modules/gts/build/src/cli.js:4:12)
    at run (/Users/beckwith/.nvm/versions/node/v8.9.1/lib/node_modules/gts/build/src/cli.js:52:12)
@jinwoo
Copy link
Member

jinwoo commented Nov 13, 2017

Does it happen only when you explicitly pass the files?

@JustinBeckwith
Copy link
Collaborator Author

It seems to only happen when I pass arguments in the folder/*.ext format. Running gts check lib/discovery.ts works fine.

Same bug applies to fix.

@jinwoo
Copy link
Member

jinwoo commented Nov 13, 2017

Are you on windows?

@JustinBeckwith
Copy link
Collaborator Author

lol no

@jinwoo
Copy link
Member

jinwoo commented Nov 13, 2017

This sounds like the wildcard expansion doesn't happen from the shell. Let me take a look.

@jinwoo jinwoo self-assigned this Nov 13, 2017
@jinwoo
Copy link
Member

jinwoo commented Nov 13, 2017

Now I know why this happens. It's because the shell expansion for lib/*.ts also includes those *.d.ts files.

@jinwoo
Copy link
Member

jinwoo commented Nov 14, 2017

I'm not sure what's the correct fix here. We could change so that

  1. gts ignores *.d.ts files
  2. Discourage people from using wildcards

Maybe 1 is better?

@JustinBeckwith
Copy link
Collaborator Author

Interesting! I'm pretty sure I've used tslint against d.ts files - why wouldn't that work?

@jinwoo
Copy link
Member

jinwoo commented Nov 14, 2017

I'm not sure. In google-api-nodejs-client, the *.d.ts files are not recognized by the typescript server. My fix will be "Ignore files that are not recognized by the typescript server".

jinwoo added a commit to jinwoo/ts-style that referenced this issue Nov 14, 2017
This is needed when files are explicitly passed to
gts. Just ignore them.

This addresses google#86
jinwoo added a commit to jinwoo/ts-style that referenced this issue Nov 14, 2017
This is needed when files are explicitly passed to
gts. Just ignore them.

This addresses google#86
JustinBeckwith pushed a commit that referenced this issue Nov 14, 2017
* fix: ignore files that are not found

This is needed when files are explicitly passed to
gts. Just ignore them.

This addresses #86

* add a test
@JustinBeckwith
Copy link
Collaborator Author

Fixed by #87

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

No branches or pull requests

2 participants