I checked the way I’m using it, but what does this mean?:
‘’’
import { gql } from "@apollo/client";
^^^^^^
SyntaxError: Cannot use import statement outside a module
I checked the way I’m using it, but what does this mean?:
‘’’
import { gql } from "@apollo/client";
^^^^^^
SyntaxError: Cannot use import statement outside a module
For further actions, you may consider blocking this person and/or reporting abuse
Aryaman M Singha -
Favour Onyeke -
Kelechi Ogbonna -
Nik L. -
Top comments (7)
Try to use require.
const { gql } = require('@apollo/client').
Or if you want it that way 'using import', you have to run it using npm start.
Hope it help. CMIIW.
So run “nodeman index”?
import { gql } from '@apollo/client'
☝️npm start
const { gql } = require('@apollo/client’)
☝️ node index.js
THABK YOI!! Well, that error comes up when I try and add my ...coffeeMutation.Mutation
Then it throws that error
So, it’s running now.... but there’s still an error of a constructor
if you don't mind, maybe you can share your repo link
Now it’s saying the same for “can’t find module react” .... what does that mean???