Access a community of over 900,000 Shopify Merchants and Partners and engage in meaningful conversations with your peers.
import PredictiveSearch from '@shopify/theme-predictive-search';
const temp = () => {
const predictiveSearch = new PredictiveSearch({
resources: {
type: [PredictiveSearch.TYPES.PRODUCT],
limit: 4,
},
});
predictiveSearch.on('success', (json) => {
console.log('success!', json);
});
predictiveSearch.on('error', (error) => {
console.error('error :', error.message);
});
predictiveSearch.query('dark-star');
};
export default temp;
index.js:1 error : Content-Type error: Content-Type was not provided or is of wrong type
at new ContentTypeError (http://localhost:3000/static/js/vendors~main.chunk.js:191311:21)
at XMLHttpRequest.xhr.onreadystatechange (http://localhost:3000/static/js/vendors~main.chunk.js:191032:17)
User | RANK |
---|---|
5 | |
4 | |
4 | |
4 | |
3 |