I'm trying to get a notification on addition of a product in cart but getting this warning, don't know what is causing it.
DevTools failed to load SourceMap: Could not load content for http://localhost:3000/js/noty.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
I have installed 'noty' using yarn
import axios from 'axios'
import Noty from 'noty'
function updateCart(pizza) {
axios.post('/update-cart', pizza).then(res => {
cartCounter.innerText = res.data.totalQty
new Noty({
type: 'success',
timeout: 1000,
text: 'Item added to cart',
progressBar: false,
}).show();
}).catch(err => {
new Noty({
type: 'error',
timeout: 1000,
text: 'Something went wrong',
progressBar: false,
}).show();
})
}
addToCart.forEach((btn) => {
btn.addEventListener('click', (e) => {
let pizza = JSON.parse(btn.dataset.pizza)
updateCart(pizza)
})
})
scss
@import '~noty/src/noty.scss';
@import '~noty/src/themes/mint.scss';
.noty_theme_mint {
border-radius: 50px!important;
padding-left: 8px!important;
}