Skip to content

Fix apollo-client import error: 'import' and 'export' may only appear at the top level#13

Open
jessedvrs wants to merge 1 commit intoHriBB:masterfrom
jessedvrs:fix-import
Open

Fix apollo-client import error: 'import' and 'export' may only appear at the top level#13
jessedvrs wants to merge 1 commit intoHriBB:masterfrom
jessedvrs:fix-import

Conversation

@jessedvrs
Copy link
Copy Markdown

When importing from 'apollo-client/transport/networkInterface', the transpiler gives the error:

Error: Parsing file node_modules/apollo-client/transport/networkInterface.js: 'import' and 'export' may only appear at the top level (10:0)

Which is fixed when importing directly from 'apollo-client'. Unfortunately, printRequest isn't exposed that way, so I copied the function from here. Therefore, I had to add graphql-tag as a direct dependency.

With this low risk fix, everything works fine again.

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

Successfully merging this pull request may close these issues.

1 participant