I've tried various ways of calling sideEffect(), but none have worked, I can't find any documentation or examples online, and the source code is a bit too abstract for me to understand without spending considerably longer looking at it.
As an example:
const y = await g.V().hasId('a4b64522-9cda-1b34-8f76-634242933a0d').sideEffect('drop()').next();
Results in
Error: Server error: {"requestId":"8915089a-cde3-4861-b73a-2534cefbc0b2","code":"InternalFailureException","detailedMessage":"Could not locate method: NeptuneGraphTraversal.sideEffect([drop()])"} (599)
I'm running these traversals against AWS Neptune in case that matters (although running similar queries through Python and the Gremlin Console against Neptune work).