Skip to content

apollo service:push fails because it makes assumptions about the environment #1132

@ThomWright

Description

@ThomWright

Intended outcome:

Successful apollo service:push

Actual outcome:

Failed apollo service:push

Error: EISDIR: illegal operation on a directory, read
    at Object.loadConfig (/app/node_modules/apollo-language-server/lib/config/loadConfig.js:49:50)

How to reproduce the issue:

Create an empty directory called .env in the root of the project and run apollo service:push.

Versions

apollo@2.6.2
apollo-language-server@1.5.4

Culprit

The precise problem is that apollo-language-server checks for the existence of .env, and assumes that if it exists then it is a config file it can read. In this case it is a directory. In fact, it could be a directory or a completely irrelevant file.

In general the problem is that apollo-language-server tries to make guesses about the environment it's running in. I would much prefer to configure it with explicit arguments (to the CLI, which are passed to the apollo-language-server library). I would rather it didn't look at my files, or my environment variables.

I should be able to be free to do what I want with my environment without worrying about nested dependencies looking at it and breaking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions