nuxt-modules / algolia

🔎 Algolia module for Nuxt
https://algolia.nuxtjs.org/
MIT License
191 stars 35 forks source link

Add indexer object to config defaults #68

Closed digbyk closed 2 years ago

digbyk commented 2 years ago

Added empty indexer object to defaults to prevent error on startup on line 153 when no indexer is present in nuxt.config.ts

I noticed when upgrading to 1.0.0 that the module wouldn't load unless an indexer object was present in nuxt.config, giving the following error: Cannot start nuxt: Cannot convert undefined or null to object
at Function.keys () at setup (/.../node_modules/@nuxtjs/algolia/dist/module.mjs:174:16)

Types of changes

Description

This fixes the error described above. I means you don't need an indexer object in the nuxt.config when one isn't needed.

Checklist:

netlify[bot] commented 2 years ago

Deploy Preview for nuxt-algolia-module canceled.

Name Link
Latest commit 00404f3f8e28d1582b9ed25ac3eb76b0af3e9e5d
Latest deploy log https://app.netlify.com/sites/nuxt-algolia-module/deploys/62bde4e64ac36c0009e0c532
Baroshem commented 2 years ago

Hey @digbyk

Sorry for no contact from my side. I completely missed this PR. For some reason, PR's are not appearing in my notifications in Github, while reported issues are there normally.

I fixed this issue another way in the 1.0.1 version so it should not appear anymore. I basically added a check that if there no config object was provided it should not try to convert it to object. It fixed the issue as well

I will merge your code as well. It wont break anything but can add another safety layer to the configuration :)

Baroshem commented 2 years ago

I will merge it and release it with 1.1.0 that will be release in few weeks probably :)

digbyk commented 2 years ago

Great. Thanks for letting me know. Kudos for all your hard work on this.