br41nslug / directus-websocket-subscribe

An extension to subscribe to directus updates over a websocket.
MIT License
106 stars 13 forks source link

When set WEBSOCKET_CORE_SUBSCRIBE='true', cannot start directus #21

Closed loongmxbt closed 1 year ago

loongmxbt commented 1 year ago

Hi, when I add WEBSOCKET_CORE_SUBSCRIBE='true' in my env,

[16:43:42.717] INFO: Websocket listening on ws://localhost:8082/websocket
/Users/dragonszy/Github/elecsim/elecsim-pg-dapi/node_modules/.store/directus-extension-websocket-subscribe@3.0.10/node_modules/directus-extension-websocket-subscribe/dist/index.js:1

TypeError: Cannot read properties of undefined (reading 'buildDispatcher')

The following .env can start directus

WEBSOCKET_PUBLIC='true'
WEBSOCKET_PATH="/websocket"
WEBSOCKET_SYSTEM='true'
WEBSOCKET_CORE='true'
WEBSOCKET_CORE_GET='true'
WEBSOCKET_CORE_POST='true'
WEBSOCKET_CORE_PATCH='true'
WEBSOCKET_CORE_DELETE='true'
umbopepato commented 1 year ago

Looks like the last published version doesn't include the correct env variables mapping (fixed in 0677edb):

image
br41nslug commented 1 year ago

Indeed those granular controls were looking at the wrong env vars 🙈