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

[bug]: 5.2.5+ breaks Parcel #1551

Closed
BigGillyStyle opened this issue Sep 11, 2024 · 3 comments
Closed

[bug]: 5.2.5+ breaks Parcel #1551

BigGillyStyle opened this issue Sep 11, 2024 · 3 comments
Labels

Comments

@BigGillyStyle
Copy link

Description

I have a fairly simple usage of algoliasearch (see repo at https://github.com/BigGillyStyle/bandsaws-react/). My repo is based off the react-instantsearch React examples ( here ). I have found when using Parcel to bundle just like in the examples, that it works up to version 5.2.4. Starting at version 5.2.5 (through 5.4.0) of algoliasearch when I run parcel build index.html I see the following error:

> BABEL_ENV=parcel parcel build index.html --no-cache

🚨 Build failed.

@parcel/core: Failed to resolve '@algolia/requester-node-http' from './node_modules/algoliasearch/dist/lite/builds/node.cjs'

  /Users/apickler/projects/woodtoolsearch/bandsaws-react/node_modules/algoliasearch/dist/lite/builds/node.cjs:28:42
    27 | var import_client_common2 = require("@algolia/client-common");
  > 28 | var import_requester_node_http = require("@algolia/requester-node-http");
  >    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    29 |
    30 | // lite/src/liteClient.ts

@parcel/resolver-default: Cannot load file './index' from module '@algolia/requester-node-http'

I am guessing, based on the limited Changelog in 5.2.5, that this is like due to this PR

Client

Search

Version

5.2.5

Relevant log output

> BABEL_ENV=parcel parcel build index.html --no-cache

🚨 Build failed.

@parcel/core: Failed to resolve '@algolia/requester-node-http' from './node_modules/algoliasearch/dist/lite/builds/node.cjs'

  /Users/apickler/projects/woodtoolsearch/bandsaws-react/node_modules/algoliasearch/dist/lite/builds/node.cjs:28:42
    27 | var import_client_common2 = require("@algolia/client-common");
  > 28 | var import_requester_node_http = require("@algolia/requester-node-http");
  >    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    29 |
    30 | // lite/src/liteClient.ts

@parcel/resolver-default: Cannot load file './index' from module '@algolia/requester-node-http'
@shortcuts
Copy link
Member

Hey @BigGillyStyle, it seems that exports resolution is opt-in on the parcel side for v2: parcel-bundler/parcel#4155 (comment)

Once this is added to your package.json, it's seamless.

@BigGillyStyle
Copy link
Author

Thanks @neehhaa06 for the very clear instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants
@BigGillyStyle @shortcuts and others