apollographql / apollographql/apollo-tooling

Errors with directory names that look like files (.ts/.js)

Open
#1,311 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3k
Forks
460
PR merge metrics
No merged PRs in 30d

Description

**note:**
my editor format base.js so the line is not 109 is 94.
maybe this is more a feature not documented, let me know.

**Intended outcome:**
Having a folder with a name extension include in base.js>fileAssociations show a warning, error with a file name would be nice

this happened using Apollo GraphQL for VS Code and someone name a folder char.js

**Actual outcome:**

{ Error: EISDIR: illegal operation on a directory, read
at Object.fs.readSync (fs.js:632:3)
at tryReadSync (fs.js:472:20)
at Object.fs.readFileSync (fs.js:513:19)
at Object.fs.readFileSync (ELECTRON_ASAR.js:563:29)
at GraphQLClientProject.fileDidChange (/home/kurabe/.vscode/extensions/apollographql.vscode-apollo-1.7.1/node_modules/apollo-language-server/lib/project/base.js:109:29)
at connection.onDidChangeWatchedFiles.params (/home/kurabe/.vscode/extensions/apollographql.vscode-apollo-1.7.1/node_modules/apollo-language-server/lib/server.js:95:25)
at handleNotification (/home/kurabe/.vscode/extensions/apollographql.vscode-apollo-1.7.1/node_modules/vscode-jsonrpc/lib/main.js:489:43)
at processMessageQueue (/home/kurabe/.vscode/extensions/apollographql.vscode-apollo-1.7.1/node_modules/vscode-jsonrpc/lib/main.js:260:17)
at Immediate.setImmediate [as _onImmediate] (/home/kurabe/.vscode/extensions/apollographql.vscode-apollo-1.7.1/node_modules/vscode-jsonrpc/lib/main.js:247:13)
at runCallback (timers.js:696:18) errno: -21, syscall: 'read', code: 'EISDIR' }

**How to reproduce the issue:**
name a folder with some of the extension of base.js>fileAssociations

**Versions**
apollographql.vscode-apollo-1.7.1 with apollo-language-server v1.9.1

Contributor guide

Open the contributing guide

Research direction

Start in apollo-language-server/lib/project/base.js at GraphQLClientProject.fileDidChange, especially the fileAssociations handling identified by the report. Reproduce the case with a directory named like a configured .js or .ts file and inspect how the EISDIR error is handled. Done means the directory no longer causes an unhandled read error and produces the requested warning or file-specific error.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.