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

Export missing modules: searchSuggestions, productSuggestions #15

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

satelllte
Copy link
Collaborator

Resolves errors like:

TypeError: Object(...) is not a function
    at searchSuggestionsPage (webpack-internal:///./pages/api/suggestions.js:10:102)
    at apiResolver (/Projects/XXXXXXX/react-storefront/node_modules/next/dist/next-server/server/api-utils.js:8:7)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async DevServer.handleApiRequest (/Projects/XXXXXXX/react-storefront/node_modules/next/dist/next-server/server/next-server.js:48:397)
    at async Object.fn (/Projects/XXXXXXX/react-storefront/node_modules/next/dist/next-server/server/next-server.js:40:218)
    at async Router.execute (/Projects/XXXXXXX/react-storefront/node_modules/next/dist/next-server/server/router.js:38:67)
    at async DevServer.run (/Projects/XXXXXXX/react-storefront/node_modules/next/dist/next-server/server/next-server.js:49:494)
    at async DevServer.handleRequest (/Projects/XXXXXXX/react-storefront/node_modules/next/dist/next-server/server/next-server.js:18:101)

Comment on lines 6 to 8
async function productSuggestions(params, req, res): Promise<Product[]> {
const result = await Promise.resolve([]);
return result;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why this is needed. This should be equivalent to the previous implementation. I suspect your changes to the index file was the real fix.

Comment on lines 7 to 11
const result = await Promise.resolve({
text: '',
groups: [],
})
return result
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

@satelllte satelllte force-pushed the patch/missing-suggestions-handlers branch from b4c2aa5 to ef87487 Compare September 8, 2020 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants