algoliasearch-netlify icon indicating copy to clipboard operation
algoliasearch-netlify copied to clipboard

1.0.13 breaks build

Open reilnuud opened this issue 3 years ago • 5 comments

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.

reilnuud avatar Feb 10 '22 19:02 reilnuud

Hey @reilnuud

Thanks for reporting, I confirm the issue, it must have slipped during our review. I'll try to post a fix today.

bodinsamuel avatar Feb 11 '22 10:02 bodinsamuel

Hi again,

We have released a new version that revert node-fetch until we figure out the best way to make it work.

However we have been by a second issue that happen for some Typescript configuration (not related from us). So you can try to upgrade to 1.0.14 but you might encounter the same error as this person unfortunately #713

I'll keep you posted on the fix, Thanks again for reporting 🙏🏻

bodinsamuel avatar Feb 11 '22 17:02 bodinsamuel

Thanks! We'll test the new version next week.

reilnuud avatar Feb 11 '22 18:02 reilnuud

Hi I encountered same error with 1.0.14 version image

benistary avatar Apr 23 '22 07:04 benistary

Hello, We have released the 1.0.15, can you try and see if it fixes your issue?

bodinsamuel avatar Apr 26 '22 08:04 bodinsamuel