Closed leytonlyy closed 5 months ago
Hey @leytonlyy! ππ»
Can you try the same while important the middleware
stack inside the routeHandlerModifier
function?
import { defineConfig } from '@adonisjs/transmit'
export default defineConfig({
pingInterval: false,
transport: null,
async routeHandlerModifier(route) {
const { middleware } = await import('#start/kernel')
if (route.getPattern() === '/__transmit/events') {
console.log(middleware)
return
}
},
})
Hi @RomainLanz, it worked thank you ! Do you know why this is happening ?
Also noticed that getPattern
method returns the route pattern as __transmit/events
instead of /__transmit/events
as stated in the Adonis documentation of transmit
Documentation has been updated. ππ»
Package version
1.0.0
Describe the bug
I'm trying to use the silent auth middleware in the RouteHandlerModifier property when configuring transmit but when i do so the app crashes on boot. I cloned the 'Transmit-demo' repository and added the code stated in the docs in the
config/transmit.ts
file:This is the error i get:
It appears that interacting with the middleware within the makes the app crash:
Generates the same error.
Reproduction repo
https://github.com/RomainLanz/transmit-demo/