fix: Algolia scraper import json syntax #6226
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Situation
The CircleCI job "Run Algolia scraper" fails to run.
The error is
Logs
See https://app.circleci.com/pipelines/github/cypress-io/cypress-documentation/26567/workflows/94363567-384d-4e59-9a5b-88987d84c5f1/jobs/67593
Assessment
cypress-documentation/scripts/search/scrape-and-compare-algolia-index.mjs
Line 26 in 4b29f22
uses
import ... assert { type: 'json' }
In Node.js 22.x only Import attributes are available. The experimental Import assertions from Node.js
18.17.1
are no longer supported. This was announced in the Node.js 22.0.0 release notes.Change
In scripts/search/scrape-and-compare-algolia-index.mjs change from experimental Import assertions to Import attributes in the import statement for compatibility with Node.js
22.x
:import config from './config.json' with { type: 'json' }
Verification
Monitor the success of the CircleCI job "Run Algolia scraper" after PR merge into
main
branch.