br41nslug / directus-websocket-subscribe

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

Cannot run directus-websocket-subscribe with the latest npm version #23

Closed loongmxbt closed 1 year ago

loongmxbt commented 1 year ago

Hi, I've tried "directus-extension-websocket-subscribe": "^3.1.11" with "directus": "10.2.1"/"10.0.0", and the directus shows the error message. The repo said has already tested with directus 10. So is the npm version the latest build? How can I use the package along with directus v10.

BTW, I was able to run along with "directus": "9.24.0".

SyntaxError: Cannot use import statement outside a module
              at Object.compileFunction (node:vm:360:18)
              at wrapSafe (node:internal/modules/cjs/loader:1119:15)
              at Module._compile (node:internal/modules/cjs/loader:1155:27)
              at Object.Module._extensions..js (node:internal/modules/cjs/loader:1245:10)
              at Module.load (node:internal/modules/cjs/loader:1069:32)
              at Function.Module._load (node:internal/modules/cjs/loader:904:12)
              at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:169:29)
              at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
              at async Promise.all (index 0)
              at async ESMLoader.import (node:internal/modules/esm/loader:530:24)
br41nslug commented 1 year ago

Thanks will double check the npm deploy later today 😄

br41nslug commented 1 year ago

You were absolutely right! The version deployed to npm was missing the type: module in its "package.json". I have republished and tested with the latest version. it should be resolved 😄