Skip to content

Avoid throwing Errors on missing variables #64

@VeiaG

Description

@VeiaG

if (!options.uri) throw new Error('[@payloadcms-vectorize/mongodb] `uri` is required')

And couple other lines prevents using "pnpm generate:types" and "pnpm generate:importmap" without environment variables ( for example in CI ), which i think is a big issue.

For example, CI to generate payload-types and publish them as separate package - will not work with this plugin. And there is a couple other uses for it.

I understand that these variables are required, but still i don't see value in throwing errors on initialization of a plugin/adapter.

Easiest fix - replace throwing errors with payload.logger.error("...."), and/or "disable" plugin when there is no required variables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions