Unable to subscribe with Amplify

239 Views Asked by At

I'm getting this error message while trying to subscribe using amplify. The error message does not make sense. I am not sure what variable it is referring to. I"ve push all my changes up again to make sure but still the same.

subscription.current = API.graphql(
      graphqlOperation(subscriptions.onCreatePurchasedPackage, {
        owner: userInfo.userName,
        authMode: "AMAZON_COGNITO_USER_POOLS",
      })
    );

    observable.current = await subscription.current.subscribe({
      next: ({ provider, value }) =>
        console.log({
          "onCreatePurchasedPackage changed the provider": provider,
          "the value": value,
        }),
      error: (error) => console.warn(error),
    });

"Validation error of type UndefinedVariable: variable not found"

"dependencies": {
    "@aws-amplify/ui-react": "^3.2.0",
    "@testing-library/jest-dom": "^5.16.4",
    "@testing-library/react": "^13.3.0",
    "@testing-library/user-event": "^13.5.0",
    "@types/jest": "^27.5.2",
    "@types/node": "^16.11.45",
    "@types/react": "^18.0.15",
    "@types/react-dom": "^18.0.6",
    "aws-amplify": "^4.3.27",
    "aws-appsync": "^4.1.7",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-hook-form": "^7.33.1",
    "react-router-dom": "^6.3.0",
    "react-scripts": "5.0.1",
    "typescript": "^4.7.4",
    "web-vitals": "^2.1.4"
  },
0

There are 0 best solutions below