elastic / search-ui

Search UI. Libraries for the fast development of modern, engaging search experiences.
https://docs.elastic.co/search-ui
Apache License 2.0
1.92k stars 368 forks source link

Cannot read properties of undefined (reading 'protocol') #961

Closed lephuhung closed 1 year ago

lephuhung commented 1 year ago

I'm using appsearch ui created from enterprice search Elastic + Kibana: 8.7 "@elastic/react-search-ui": "^1.19.1", "@elastic/search-ui-app-search-connector": "^1.19.1", "react": "^17.0.2", "react-dom": "^17.0.2", "react-scripts": "5.0.0" when i change number of result 20 to 40 or 60, server error: Compiled with problems: ERROR Cannot read properties of undefined (reading 'protocol') TypeError: Cannot read properties of undefined (reading 'protocol') at http://localhost:3000/static/js/bundle.js:2090:47 at Result (http://localhost:3000/static/js/bundle.js:1414:98) at renderWithHooks (http://localhost:3000/static/js/bundle.js:36696:22) at mountIndeterminateComponent (http://localhost:3000/static/js/bundle.js:39179:17) at beginWork (http://localhost:3000/static/js/bundle.js:40233:20) at HTMLUnknownElement.callCallback (http://localhost:3000/static/js/bundle.js:27271:18) at Object.invokeGuardedCallbackDev (http://localhost:3000/static/js/bundle.js:27315:20) at invokeGuardedCallback (http://localhost:3000/static/js/bundle.js:27370:35) at beginWork$1 (http://localhost:3000/static/js/bundle.js:44366:11) at performUnitOfWork (http://localhost:3000/static/js/bundle.js:43377:16)

Thank for reading

chriscressman commented 1 year ago

when i change number of result 20 to 40 or 60

Can you show how you are making this change?

lephuhung commented 1 year ago

when i change number of result 20 to 40 or 60

Can you show how you are making this change?

b9397b9ffd6821367879 here!!!

chriscressman commented 1 year ago

Thanks, I thought you were referring to a code change. I see now that you're using the generated application without any changes.

I should have time later to try to reproduce the issue.

lephuhung commented 1 year ago

Thanks, I thought you were referring to a code change. I see now that you're using the generated application without any changes.

I should have time later to try to reproduce the issue.

thank for reply, if you need zip source code from enterprice seach, i can email for you!

chriscressman commented 1 year ago

I ran the following test and did not experience the issue:

  1. Create deployment on Elastic Cloud
  2. Create App Search engine using sample data
  3. Generate and download Search UI application
  4. Run application using commands below
  5. Search for documents and change per page (no messages in console)

Commands I ran to start the app:

nvm install
nvm use
nvm install-latest-npm
npm install
npm start

This doesn't solve the problem but may help isolate the issue.

joemcelroy commented 1 year ago

what does it say in the network tab? Do you see a request being performed for the size change? Does it fail in an error?

lephuhung commented 1 year ago

I ran the following test and did not experience the issue:

  1. Create deployment on Elastic Cloud
  2. Create App Search engine using sample data
  3. Generate and download Search UI application
  4. Run application using commands below
  5. Search for documents and change per page (no messages in console)

Commands I ran to start the app:

nvm install
nvm use
nvm install-latest-npm
npm install
npm start

This doesn't solve the problem but may help isolate the issue.

can you post package.json of project

lephuhung commented 1 year ago

what does it say in the network tab? Do you see a request being performed for the size change? Does it fail in an error?

sorry for late, here is screenshot when i change number of page, elastic always return search.json 40, 60 per page, but front-end cannot render Screenshot from 2023-04-15 21-25-11 Screenshot from 2023-04-15 21-25-25 Screenshot from 2023-04-15 21-25-38

lephuhung commented 1 year ago

I ran the following test and did not experience the issue:

  1. Create deployment on Elastic Cloud
  2. Create App Search engine using sample data
  3. Generate and download Search UI application
  4. Run application using commands below
  5. Search for documents and change per page (no messages in console)

Commands I ran to start the app:

nvm install
nvm use
nvm install-latest-npm
npm install
npm start

This doesn't solve the problem but may help isolate the issue.

hi, when i change engine.json is "endpointBase": "https://search-ui-sandbox.ent.us-central1.gcp.cloud.es.io", "engineName": "national-parks", everything is ok, not error, so i think my elastic server error with suggestion search so front-end will be error. Can you have project search-ui code by typecript?

botelastic[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Is this issue still important to you? If so, please leave a comment and let us know. As always, thank you for your contributions.