[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.
#```[12:43:14.768] WARN: No "exports" main defined...
59 messages · Page 1 of 1 (latest)
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.)
Yes
A lot of stuff
But before eveyrthing worked fine
Don't, the directus package doesnt consist of much.
Even on production env
I mean i use it in a lot of places
And also it worked befor
eg
it just worked well befroe
So what could be the issue?
yeah thats been wrong for a long time, import those from the appropriate @directus/..... pacakges
Uh , whats the reason of this change ?
(i know it used to work a while ago but that was a bug)
or well it was unintentional and not documented 🙂
ForbiddenException, InvalidPayloadException, RouteNotFoundException,
What i need to instal to get access to this stuff
To exceptions
Not to sure for 9.26 but if you update that would be @directus/errors
actually, you're making an extension right? no need to import those at all before v10. They're provided to you
Im making extension ( but using typescritp and second method of making exceptions )
This is how i define my main route
utils.exceptions has all you need
Uhh
Okay
Thats how it used to work 🤷♂️
There is only dist package
no this utils object
ITs much harder to transfer utils to like 40 files then just exporting error
- i need to use them as types
Same with itemsStore
...
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
Okay , upgrade would be probably the good idea
But i am curious why it suddenly stopped working for you if you didnt update 🤷♂️ did you accidentally update the extension-sdk maybe
There was package like '@directus/api' few monthes ago
thats still available
sounds like the latest version
beware of breaking changes when updating (ur going 2 major versions of the api up there)
Okay
@trim beacon ( what version of errors should i use to make this work )
I installed latest
And still not works
I will just use that api version lol
Uh , okay. I see. You just change the method of showing the erorrs
hope that doesnt create conflicts for ya
erros*
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
Okay sory
AbstractServiceOptions also from where could i import this type?