#Upgrading from v9.26.0 to v10.0.0 - changes to directus/server?

3 messages · Page 1 of 1 (latest)

ashen hornet
#

I just upgraded Directus, performed a new npm install, ran npx init boostrap. Everything seemed fine, I just saw a few extension issues in the traces, nothing else.
Starting Directus from IIS now throws a Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './server' is not defined by "exports" error message.

The index.js file called by IIS includes:

trustServerCertificate: true,
startServer();```

So I suppose this is due to the `require('directus/server')` now being an ES module?
What's the appropriate method to start Directus now without docker or docker-compose? If not by the above, how can you add Elastic APM or NewRelic in case it is required? Would have done so by adding `require('newrelic');` above.
lavish socketBOT
#

Thanks for posting! This is a community powered server, so you may or may not get an answer based on available help and expertise. To increase your chances of somebody being able to help you, please help us help you making sure you:

  • Adding an explanation of exactly what you're trying to achieve.
  • Adding any and all related code or previous attempts.
  • Describing the exact issue or error you are facing.
  • Posting any screenshots if applicable.
  • Reading through https://stackoverflow.com/help/how-to-ask.

When you're done with this thread, please close it. Thanks! ✨

(If you have a support agreement and need help, please contact the core team via email.)

ashen hornet
#

Small update. I guess this has to do with the changes in v9.25.0 but I haven't experienced the issue even when upgrading to v9.26.0:

In this one, we've updated the API codebase from CJS to ESM. From our testing, this should be backwards compatible with API-extensions created with the extensions-sdk. However, due to the finicky nature of this change in Node, please do make sure to test your extensions before updating to this version. If you're running into ESM-CJS import issues, try renaming your extension output to .cjs instead of .js or bundle it to native ESM.```

So how would you now call the startServer function?