Skip to content

Monorepo failures due to thrown errors #153

@genu

Description

@genu

algolia/src/module.ts

Lines 71 to 86 in d0af3d9

if (!options.apiKey) {
throw new Error('`[@nuxtjs/algolia]` Missing `apiKey`')
}
if (!options.applicationId) {
throw new Error('`[@nuxtjs/algolia]` Missing `applicationId`')
}
if (options.crawler!.apiKey || options.crawler!.indexName) {
if (!options.crawler!.apiKey) {
throw new Error('`[@nuxtjs/algolia]` Missing `crawler.apiKey`')
}
if (!options.crawler!.indexName) {
throw new Error('`[@nuxtjs/algolia]` Missing `crawler.indexName`')
}

I don't think Errors should be thrown here because it will always fail sibling projects. This happens because in a monorepo the nuxt postinstall script will always run, which will throw these errors for every project except the nuxt project due to the missing env vars.

Instead of throwing here, warning should be emitted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions