Code Monkey home page Code Monkey logo

gridsome-plugin-algolia's People

Contributors

cprestoncowart avatar darrenmothersele avatar shayaulman avatar u12206050 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gridsome-plugin-algolia's Issues

Error: Algolia failed: ID is not defined

Hello, thanks a lot for this plugin, I recently just added a modified field in my frontmatter so i could use partial updates in the plugin, but when I try to build, I get this error:

Algolia collection #0: Executing query
Algolia collection #0: items in collection 5
Algolia collection #0: starting Partial updates
Algolia collection #0: found 6 existing items
Error: Algolia failed: ID is not defined at afterBuild (/home/edmund/projects/projects/my own/NinjaBlog/node_modules/gridsome-plugin-algolia/index.js:184:13)

This is how my config looks:

const collections = [
  {
    query: `{
      allPost {
        edges {
          node {
            id
            title
            path
            modified
          }
        }
      }
    }`,
    transformer: ({ data }) => data.allPost.edges.map(({ node }) => node),
    indexName: process.env.ALGOLIA_INDEX_NAME, // Algolia index name
    itemFormatter: item => {
      return {
        objectID: item.id,
        title: item.title,
        slug: item.path,
        modified: String(item.modified)
      };
    }, // optional
    matchFields: ['modified'] // Array<String> required with PartialUpdates
  }
];



module.exports = {

  plugins: [
 {
      use: `gridsome-plugin-algolia`,
      options: {
        appId: process.env.ALGOLIA_APP_ID,
        apiKey: process.env.ALGOLIA_ADMIN_KEY,
        collections,
        chunkSize: 10000, // default: 1000
        enablePartialUpdates: true // default: false
      }
]
  }

I have my .env file in place and all keys provided there.

I'm currently using the version 2.1.2 of the plugin.

Avoid using api.store directly

While running gridsome develop I got the following warning:

 WARNING  Deprecation notices

Avoid using api.store directly. Use the actions in api.loadSource() instead.
./node_modules/gridsome-plugin-algolia/index.js:2:17   

Gridsome version: 0.7.9
Plugin Version: 2.1.2

Algolia: Response not successful: Received status code 429

Hello, I have a problem with rate limitations and Algolia. Netlify gives me the following error: Algolia: Response not successful: Received status code 429. Do you have any tips on how we can avoid this using your plugins in Gridsome?

Thanks

Error: Algolia failed: report is not defined

Hi there!

Thank you for taking time to port this plugin and contributing to Gridsome's plugin ecosystem. I was following your instruction of how to setup this plugin with my project. When I build the project however, I'm getting the following error:

Algolia collection #0: Executing query
Error: Algolia failed: report is not defined

I've searched the internet for a meaning of this error, found none! Can you please let me know what am I doing wrong?

Thank you, once again!

Environment Variables

I have a .evn.development with the following variables defined

ALGOLIA_APP_ID=123456789
ALGOLIA_API_KEY=123456789
ALGOLIA_INDEX_NAME=blog_posts

I know your instructions have an example where you require dotenv but it's already built into Gridsome. If you look at the docs it says that we should be able to use these values in our configuration https://gridsome.org/docs/environment-variables

When I use the actual values everything works fine but when I try to use the environment variables like so

    {
      use: `gridsome-plugin-algolia`,
      options: {
        appId: process.env.ALGOLIA_APP_ID,
        apiKey: process.env.ALGOLIA_API_KEY,
        collections,
        chunkSize: 10000, // default: 1000
        enablePartialUpdates: false, // default: false
      },
    },

I get the following error:

AlgoliaSearchError: Please provide an application ID. Usage: algoliasearch(applicationID, apiKey, opts)
    at AlgoliaSearchNodeJS.AlgoliaSearchCore (/Users/vega/dev/gridsome/danvega-dev/node_modules/algoliasearch/src/AlgoliaSearchCore.js:50:11)
    at AlgoliaSearchNodeJS.AlgoliaSearch (/Users/vega/dev/gridsome/danvega-dev/node_modules/algoliasearch/src/AlgoliaSearch.js:11:21)
    at AlgoliaSearchNodeJS.AlgoliaSearchServer (/Users/vega/dev/gridsome/danvega-dev/node_modules/algoliasearch/src/server/builds/AlgoliaSearchServer.js:17:17)
    at new AlgoliaSearchNodeJS (/Users/vega/dev/gridsome/danvega-dev/node_modules/algoliasearch/src/server/builds/node.js:79:23)
    at algoliasearch (/Users/vega/dev/gridsome/danvega-dev/node_modules/algoliasearch/src/server/builds/node.js:68:10)
    at afterBuild (/Users/vega/dev/gridsome/danvega-dev/node_modules/gridsome-plugin-algolia/index.js:58:20)
    at Promise.all.events.(anonymous function).map (/Users/vega/dev/gridsome/danvega-dev/node_modules/gridsome/lib/app/App.js:144:41)
    at Array.map (<anonymous>)
    at App.dispatch (/Users/vega/dev/gridsome/danvega-dev/node_modules/gridsome/lib/app/App.js:143:47)
    at module.exports (/Users/vega/dev/gridsome/danvega-dev/node_modules/gridsome/lib/build.js:53:13)

This only happens on the build so these values should be injected. Any idea why this wouldn't work? I got a basic search working but until I can extract these values to env variables I can't push this code. Thanks again for the plugin!

Getting an error

Thanks for putting this together. When I run buildin gridsome, I'm getting this error:

Error: Algolia failed: report is not defined
at afterBuild (/Users/chrisemery/Sites/tbs-gridsome-2019/node_modules/gridsome-plugin-algolia/index.js:174:13)
at process._tickCallback (internal/process/next_tick.js:68:7)

Any suggestions you might have to fix it would be greatly appreciated. Thanks.

Error: Algolia failed: Cannot read property 'map' of undefined

Hello!

I'm getting this error when running gridsome build. Indeed, the result from the GraphQL query is null, but running the same query in the Gridsome GraphQL playground returns the expected result, with actual posts.

From index.js, line 130, if I add a console.log

const result = await graphql(query);
console.log(result);

I end up with

{
  data: [Object: null prototype] {
    allDocPage: [Object: null prototype] { edges: [Array] }
  }
}
Error: Algolia failed: Cannot read property 'map' of undefined

Any idea what could be happening here?

Do you have any examples?

Do you have any examples of using this on a Gridsome blog somewhere? I am a little confused on the fields. Do you have an id in front matter for every single blog post? I don't generate IDs because they aren't being saved anywhere so I wonder if the slug is good enough.

Also, I don't have a modified date but it seems like I am going to need one because I don't want to regenerate this on every build. Do you have the modified field on every single blog post or just when one changes?

Thanks for creating this plugin!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.