#Local API payload.init config

2 messages · Page 1 of 1 (latest)

bitter osprey
#

Hi there.

I’ve been trying to get the local API working in Nuxt 3 server middleware and have actually got it working (can share an example after some refactoring and cleanup).

However I have a question on specifying the config directly to payload.init(). Currently, if I pass the full config to buildConfig, I’ll get an error on the server due to editor (lexical or slate) failing to load their styles for some reason. If I just remove the editor altogether, the server and API start working perfectly.

My question is, can the editor property be made optional when specifying local: true, because in my opinion it is not actually needed for local API to work?

In addition, if I specify the config directly to payload.init, why is it still looking for PAYLOAD_CONFIG_PATH? If I set it to a random string, it’ll use the passed in config correctly while correctly ignoring the config file.

frigid chasmBOT