apollo-upload-network-interface icon indicating copy to clipboard operation
apollo-upload-network-interface copied to clipboard

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

Open jessedvrs opened this issue 8 years ago • 0 comments

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.

jessedvrs avatar Mar 23 '17 09:03 jessedvrs