Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing error when "new Crawler()" is not called on line 1 of the crawler editor #2190

Open
timngyn opened this issue Feb 23, 2024 · 0 comments

Comments

@timngyn
Copy link

timngyn commented Feb 23, 2024

Description

When new Crawler({...}) is not on line 1 of the editor, there is a configuration error saying Crawler is not defined. Should this be happening?

image

In this picture, if I remove the new line above new Crawler(...) then the parsing error goes away.

Some background:

  • Our site is part of the docsearch program and I am trying to define a variable to be used in my crawler action objects for the pathsToMatch property. For some of our URLs, the records getting returned are too large and so we want to have a separate action for these URLs, as shown in this github issue comment: Extractors returned too many records #1658 (comment)
  • We have around 29 urls and so I wanted to define this as an array above the instantiation for the new Crawler and use the variable in pathsToMatch like in the above issue comment

Steps to reproduce

  1. Go to the Algolia crawler editor
  2. In the editor, add a new line above new Crawler({...})
  3. Observe that the Configuration Error tab appears on the right side, saying that there is a parsing error and that Crawler is not defined

Expected behavior

Since the editor is for editing the script, I would expect there to be no parsing error based on where the new Crawler is defined.

Environment

  • OS: Mac
  • Browser: Chrome
  • DocSearch version: 3.0.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant