#```[12:43:14.768] WARN: No "exports" main defined...

59 messages · Page 1 of 1 (latest)

white geyserBOT
#
[12:43:14.768] WARN: No "exports" main defined in /workspace/extensions/endpoints/api/node_modules/directus/package.json
    err: {
      "type": "Error",
      "message": "No \"exports\" main defined in /workspace/extensions/endpoints/api/node_modules/directus/package.json",
      "stack":
          Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /workspace/extensions/endpoints/api/node_modules/directus/package.json
              at new NodeError (node:internal/errors:405:5)
              at exportsNotFound (node:internal/modules/esm/resolve:260:10)
              at packageExportsResolve (node:internal/modules/esm/resolve:590:9)
              at resolveExports (node:internal/modules/cjs/loader:547:36)
              at Module._findPath (node:internal/modules/cjs/loader:621:31)
              at Module._resolveFilename (node:internal/modules/cjs/loader:1034:27)
              at Module._load (node:internal/modules/cjs/loader:901:27)
              at Module.require (node:internal/modules/cjs/loader:1115:19)
              at require (node:internal/modules/helpers:119:18)
              at Object.<anonymous> (/workspace/extensions/endpoints/api/index.js:1:317)
      "code": "ERR_PACKAGE_PATH_NOT_EXPORTED"
    }``` What could be the reason of this issue? This issue only apperas on my production machine.

Just so you know, we have moved your message here, @ruby moth. In future, please ask questions in one of the help channels as per the server rules.

@trim beacon was the person who moved it, so if there's aditional context, they will add it here for you. Your original post has been deleted.
#

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.)

trim beacon
#

Using directus 9.26.0

#

trying to import anything from directus by any chance?

ruby moth
#

A lot of stuff

#

But before eveyrthing worked fine

trim beacon
#

Don't, the directus package doesnt consist of much.

ruby moth
ruby moth
#

And also it worked befor

#

it just worked well befroe

#

So what could be the issue?

trim beacon
#

yeah thats been wrong for a long time, import those from the appropriate @directus/..... pacakges

ruby moth
#

Uh , whats the reason of this change ?

trim beacon
#

(i know it used to work a while ago but that was a bug)

ruby moth
#

"global" improt was a bug XD

#

Okay

trim beacon
#

or well it was unintentional and not documented 🙂

ruby moth
#

ForbiddenException, InvalidPayloadException, RouteNotFoundException,

What i need to instal to get access to this stuff

#

To exceptions

trim beacon
#

Not to sure for 9.26 but if you update that would be @directus/errors

ruby moth
#

Okay thats wrong XD

trim beacon
#

actually, you're making an extension right? no need to import those at all before v10. They're provided to you

ruby moth
#

This is how i define my main route

trim beacon
#

utils.exceptions has all you need

ruby moth
ruby moth
trim beacon
#

Thats how it used to work 🤷‍♂️

ruby moth
trim beacon
ruby moth
#
  • i need to use them as types
#

Same with itemsStore

#

...

trim beacon
#

Then upgrading would be the way to go as errors have been extracted to their own package. Any form of importing from the root package that worked was unintentional and unsupported

ruby moth
#

Okay , upgrade would be probably the good idea

trim beacon
#

But i am curious why it suddenly stopped working for you if you didnt update 🤷‍♂️ did you accidentally update the extension-sdk maybe

ruby moth
#

There was package like '@directus/api' few monthes ago

trim beacon
#

thats still available

ruby moth
#

"@directus/api": "^11.0.1",

#

okay tah should solve that problem

trim beacon
#

sounds like the latest version

#

beware of breaking changes when updating (ur going 2 major versions of the api up there)

ruby moth
#

Okay

#

@trim beacon ( what version of errors should i use to make this work )

#

I installed latest

#

And still not works

ruby moth
trim beacon
#
ruby moth
#

Uh , okay. I see. You just change the method of showing the erorrs

trim beacon
ruby moth
#

erros*

trim beacon
#

Also please give the server rules another read... this is not the first time i've moved your questions and would very much like it to be the last

ruby moth
#

AbstractServiceOptions also from where could i import this type?