algolia / instantsearch

⚡️ Libraries for building performant and instant search and recommend experiences with Algolia. Compatible with JavaScript, TypeScript, React and Vue.
https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/
MIT License
3.7k stars 518 forks source link

Can't resolve '@babel/runtime/helpers/esm/assertThisInitialized' #5260

Closed hafizmowais closed 1 year ago

hafizmowais commented 4 years ago

To Reproduce 🔍

Steps to reproduce the behavior:

  1. Install package
  2. import { InstantSearch, SearchBox, Hits } from 'react-instantsearch-dom'; just paste this line and get the error right away

Error: ./node_modules/react-instantsearch-core/dist/es/core/createConnector.js Module not found: Can't resolve '@babel/runtime/helpers/esm/assertThisInitialized' in '/path_to_project/node_modules/react-instantsearch-core/dist/es/core'

Environment:

Additional context

i am using this package with react { "name": "ProjectName", "version": "1.0.0", "dependencies": { "@mollie/api-client": "^2.3.2", "algoliasearch": "^3.35.1", "antd": "^3.16.1", "axios": "^0.18.0", "cors": "^2.8.5", "cpx": "^1.5.0", "draftjs-to-html": "^0.8.4", "express": "^4.16.4", "firebase": "^5.1.0", "firebase-admin": "^8.8.0", "firebase-functions": "^3.3.0", "google-auth-library": "^4.1.0", "i18next": "^15.0.6", "moment": "^2.24.0", "node-sass": "^4.11.0", "nodemailer": "^6.2.1", "query-string": "^6.2.0", "ramda": "^0.26.1", "react": "^16.8.3", "react-addons-css-transition-group": "^15.6.2", "react-dnd": "^5.0.0", "react-dnd-html5-backend": "^3.0.2", "react-dom": "^16.8.4", "react-draft-wysiwyg": "^1.13.2", "react-ga": "^2.6.0", "react-html-parser": "^2.0.2", "react-i18next": "^9.0.10", "react-inlinesvg": "^0.8.4", "react-loadable": "^5.4.0", "react-moment": "^0.8.4", "react-player": "^1.9.3", "react-redux": "^5.0.7", "react-redux-firebase": "^2.1.6", "react-router-dom": "^4.3.1", "react-rte": "^0.16.1", "react-scroll-into-view": "^1.5.0", "react-svg": "^10.0.3", "react-tag-input-latest": "^4.5.8", "recharts": "^1.6.2", "redux": "^4.0.0", "redux-firestore": "^0.5.7", "redux-form": "^7.4.2", "redux-form-validators": "^2.7.5", "redux-thunk": "^2.3.0", "request": "^2.88.0" }, "scripts": { "start": "react-app-rewired start", "build": "react-app-rewired --max_old_space_size=4096 build", "test": "react-scripts test", "funcs:build": "babel --verbose src/functions --out-dir dist/functions", "funcs:clean": "rimraf dist/functions", "funcs:copy": "cpx '{package.json,yarn.lock}' dist/functions && cpx src/functions/firebase-adminsdk*.json dist/functions", "prefuncs:deploy": "yarn funcs:clean && yarn funcs:build && yarn funcs:copy", "funcs:deploy": "firebase deploy --only functions", "funcs:install": "cd dist/functions && yarn", "prefuncs:server": "yarn funcs:deploy", "funcs:serve": "firebase serve --only functions --port=9000", "prefuncs:shell": "yarn funcs:build && yarn funcs:install", "funcs:shell": "firebase experimental:functions:shell" }, "devDependencies": { "@babel/cli": "^7.2.0", "@babel/core": "^7.1.0", "@babel/polyfill": "^7.0.0", "@babel/preset-env": "^7.1.0", "@firebase/testing": "^0.11.2", "babel-plugin-import": "^1.8.0", "enzyme": "^3.3.0", "enzyme-adapter-react-16": "^1.1.1", "eslint": "4.19.1", "eslint-config-airbnb": "^17.1.0", "eslint-plugin-import": "^2.14.0", "eslint-plugin-jsx-a11y": "^6.1.2", "eslint-plugin-react": "^7.11.1", "firebase-functions-test": "^0.1.6", "react-app-rewired": "^1.5.2", "react-scripts": "2.0.0-next.3e165448", "react-test-renderer": "^16.4.1", "redux-devtools-extension": "^2.13.5" }, "browserslist": { "development": [ "last 2 chrome versions", "last 2 firefox versions", "last 2 edge versions" ], "production": [ ">0.25%", "not op_mini all", "ie 11", "last 2 chrome versions", "last 2 firefox versions", "last 2 edge versions" ] }, "babel": { "presets": [ [ "@babel/env", { "targets": { "node": "6.11.5" } } ] ] }, "engines": { "node": "8" } }

yannickcr commented 4 years ago

Hello,

From what I see @babel/runtime is set as a dependency of react-instantsearch-core and, after testing, it is correctly installed. So I don't really see the issue here, unless it is something in the way you build your JavaScript?

Could you reproduce the error in a minimal example project in GitHub? So we can have a better idea of what is going on here.

sarahdayan commented 1 year ago

Hey!

We're doing a round of clean up before migrating this repository to the new InstantSearch monorepo. This issue seems not to have generated much activity lately. Is it still relevant @hafizmowais?