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

Fix storybook examples #6368

Open
gaetansenn opened this issue Sep 24, 2024 · 6 comments
Open

Fix storybook examples #6368

gaetansenn opened this issue Sep 24, 2024 · 6 comments
Labels
triage Issues to be categorized by the team

Comments

@gaetansenn
Copy link

🐛 Current behavior

This current ais-pagination example fail to open https://instantsearchjs.netlify.app/stories/vue/?path=/story/ais-pagination--

The error

algoliasearch_lite__WEBPACK_IMPORTED_MODULE_1___default(...) is not a function
TypeError: algoliasearch_lite__WEBPACK_IMPORTED_MODULE_1___default(...) is not a function
    at previewWrapper (https://instantsearchjs.netlify.app/stories/vue/main.48e6b0d8faa6bd9cd3d9.bundle.js:2:354932)
    at Module.<anonymous> (https://instantsearchjs.netlify.app/stories/vue/main.48e6b0d8faa6bd9cd3d9.bundle.js:2:562829)
    at 942 (https://instantsearchjs.netlify.app/stories/vue/main.48e6b0d8faa6bd9cd3d9.bundle.js:2:566183)
    at __webpack_require__ (https://instantsearchjs.netlify.app/stories/vue/runtime~main.48e6b0d8faa6bd9cd3d9.bundle.js:1:1301)
    at webpackContext (https://instantsearchjs.netlify.app/stories/vue/main.48e6b0d8faa6bd9cd3d9.bundle.js:2:561759)
    at https://instantsearchjs.netlify.app/stories/vue/main.48e6b0d8faa6bd9cd3d9.bundle.js:2:499063
    at Array.forEach (<anonymous>)
    at loadStories (https://instantsearchjs.netlify.app/stories/vue/main.48e6b0d8faa6bd9cd3d9.bundle.js:2:499028)
    at https://instantsearchjs.netlify.app/stories/vue/vendors~main.48e6b0d8faa6bd9cd3d9.bundle.js:2:1727128
    at render (https://instantsearchjs.netlify.app/stories/vue/vendors~main.48e6b0d8faa6bd9cd3d9.bundle.js:2:1706722)
    ```

### 🔍 Steps to reproduce

Link:  https://instantsearchjs.netlify.app/stories/vue/?path=/story/ais-pagination--

### Live reproduction

https://instantsearchjs.netlify.app/stories/vue/?path=/story/ais-pagination--*

### 💭 Expected behavior

The example works 

### Package version

latest

### Operating system

_No response_

### Browser

_No response_

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct
@gaetansenn gaetansenn added the triage Issues to be categorized by the team label Sep 24, 2024
@Haroenv
Copy link
Contributor

Haroenv commented Sep 24, 2024

Not sure what caused it (probably webpack/babel config since moving to v5 of algoliasearch). The js examples still seem to work, so you can use those instead for now: https://instantsearchjs.netlify.app/stories/js/?path=/story/pagination-pagination--default

We were thinking of possibly removing the storybooks as they don't bring much value and are decent amount of work. What are you using the storybooks for. Just to see an example of what the widget renders like or something else as well?

@gaetansenn
Copy link
Author

gaetansenn commented Sep 24, 2024

Hi @Haroenv,

Thank you for your reply. I agree with you on the usage of Storybook. I just wanted to report the bug, that's all. :)

@gaetansenn
Copy link
Author

I dont really know how to report a bug in your documentation but the liteClient is imported like this :

import { liteClient } from 'algoliasearch/lite'

and not

import { liteClient } from 'algoliasearch'

https://www.algolia.com/doc/libraries/javascript/v5/methods/search/

@Haroenv
Copy link
Contributor

Haroenv commented Sep 24, 2024

The first way is the correct way @gaetansenn, if you import from "non-lite" it's import { algoliasearch } from 'algoliasearch'

@gaetansenn
Copy link
Author

gaetansenn commented Sep 24, 2024

Yes, I know. Just point out the errors in the doc:

Screenshot 2024-09-24 at 13 59 49

@Haroenv
Copy link
Contributor

Haroenv commented Sep 24, 2024

Ah I see I misread your comment, fixing :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Issues to be categorized by the team
Projects
None yet
Development

No branches or pull requests

2 participants