You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PostDelete event contains a source property of the type EventSource. It's exported and available to import from @devvit/protos, but the runtime doesn't seem to match that.
The following code is valid, builds, and uploads:
import{EventSource,PostDelete}from"@devvit/protos";import{TriggerContext}from"@devvit/public-api";exportasyncfunctiononPostDelete(event: PostDelete,context: TriggerContext){if(event.source!==EventSource.USER){return;}// handle user deletion...console.log(`Processing user deletion of ${event.postId}`);}
However it fails when actually running on Devvit with the error: TypeError: Cannot read properties of undefined (reading 'USER')
This wasn't always the case and is affecting apps that were previously referencing the enum without issues. I am not sure when it went missing, but it was still there a few months ago.
The text was updated successfully, but these errors were encountered:
The
PostDelete
event contains a source property of the typeEventSource
. It's exported and available to import from@devvit/protos
, but the runtime doesn't seem to match that.The following code is valid, builds, and uploads:
However it fails when actually running on Devvit with the error:
TypeError: Cannot read properties of undefined (reading 'USER')
This wasn't always the case and is affecting apps that were previously referencing the enum without issues. I am not sure when it went missing, but it was still there a few months ago.
The text was updated successfully, but these errors were encountered: