algolia / algolia/algoliasearch-netlify

1.0.13 breaks build

Open
#712 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
265
Forks
10
PR merge metrics
No merged PRs in 30d

Description

Getting an error during build:

```
Error message
Could not import plugin:
/opt/build/repo/node_modules/@algolia/netlify-plugin-crawler/src/index.ts:1
import type { NetlifyPluginOptions, NetlifyPluginUtils } from '@netlify/build';
^^^^^^

SyntaxError: Cannot use import statement outside a module
```

I think upgrading `node-fetch` to a version >2 led to this problem since version >=3 doesn't support CJS. We had to downgrade to 1.0.12.

The version should either but adjusted accordingly (not a minor version) or node-fetch should be downgraded.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the build failure with version 1.0.13 and compare its node-fetch dependency with version 1.0.12. Inspect the plugin entry at node_modules/@algolia/netlify-plugin-crawler/src/index.ts and verify that the chosen versioning or dependency change allows the Netlify build to complete without the CJS/ES module error.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.