LIFT-OFF I: Import @apollo/client declaration expected

Hi there,

I’m in the “Apollo Client Setup” step of the tutorial, and I am unable to start the server because my code doesn’t compile.

The code causing the error is

import { ApolloProvider, ApolloClient, InMemoryCache } from @apollo/client;

@apollo/client has a squiggly line under it, and hovering over it in VS shows “Declaration expected.”

Why would a declaration be required for an import? Any ideas on how to fix this?

This is the second error I see for the same line of code, the first one suggested “set the ‘experimentalDecorators’ option in your ‘tsconfig’ or ‘jsconfig’ to remove this warning”. I resolved this by going to preferences -> settings in VS, Check and save the enable/disable experimentalDecorators option in the settings file.

Looks like you forgot the quotes. Should be "@apollo/client". You shouldn’t need the experimentalDecorators option.

1 Like

just a silly error! thanks for pointing it out

1 Like