Open elledienne opened 4 years ago
I am getting the same error when calling API.graphql
in Vue application
I am using @auth in my model and this is the generated code for my subscription:
subscription OnCreateCheckItemKeywords($createdBy: String) {
onCreateCheckItemKeywords(createdBy: $createdBy) {
id
checkItemId
keywordName
createdBy
checkItem {
id
content
type
createdBy
createdAt
applicableTo
controls {
nextToken
}
keywords {
nextToken
}
}
keyword {
name
createdAt
createdBy
}
}
}
This is the method in my vue app :
subscribe () {
const subscription = API.graphql(graphqlOperation(onCreateCheckItem, this.$store.state.auth.user.username))
subscription.subscribe({
next: (eventData) => {
console.log(eventData)
const checkItem = eventData.value.data.onCreateCheckItem
console.log(checkItem)
},
error: err => {
console.log('error in onCreateCheckItem subscribe', err)
},
})
},
Uncaught TypeError: Cannot read property 'error' of null
at AWSAppSyncRealTimeProvider.push../node_modules/@aws-amplify/pubsub/lib-esm/Providers/AWSAppSyncRealTimeProvider.js.AWSAppSyncRealTimeProvider._handleIncomingSubscriptionMessage (AWSAppSyncRealTimeProvider.js:499)
[DEBUG] 51:36.668 AWSAppSyncRealTimeProvider - subscription message from AWS AppSync RealTime: {"type":"error","payload":{"errors":[{"errorType":"UnsupportedOperation","message":"unknown not supported through the realtime channel"}]}}
"@aws-amplify/pubsub": "^3.0.13",
"@aws-amplify/ui-vue": "^0.2.6",
"aws-amplify": "^3.0.13",
"aws-amplify-vue": "^2.1.1",
@elorzafe @KvNGCzA I'm getting this error as well. I'm working on a Amplify React application that uses DataStore. I only began getting this error when I enabled DataStore for the API.
Do you want to request a feature or report a bug? I want to report a bug
What is the current behavior? I can't say if this is a bug that happens only in development mode (react native) or also in production, but when the app reloads after changes have been made to the js code I get an error
TypeError: Cannot read property 'error' of null
.Looking at the stack trace I could find the origin of the error in the method
AppSyncRealTimeSubscriptionHandshakeLink._timeoutStartSubscriptionAck
I believe the reason is that
observer
isnull
in some situations (can't say when).If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
createSubscriptionHandshakeLink
to link subs to ApolloClientuseSubscription
What is the expected behavior?
Which versions and which environment (browser, react-native, nodejs) / OS are affected by this issue? Did this work in previous versions?