(node:24430) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'data' of undefined
[0] at /Users/desartist22/Downloads/webpack-boilerplate-main/app.js:80:23
[0] at processTicksAndRejections (internal/process/task_queues.js:95:5)
[0] (Use `node --trace-warnings ...` to show where the warning was created)
[0] (node:24430) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
[0] (node:24430) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I am just gettin weird warnings like api.getByUID isn't a function idk whats going on
god I am using prismic because its used in this course this was worst experience ever with prismic
Thanks for the help i am really feeling so low that i cannot able to keepup with prismic. apart from that I am having a frustating experience with it dosen't mean that it isn't good it needs time to understand that i haven't invested in and went in all by taking this course from awwwards .
I'll look into this today and get back to you with what I find. Just so I know, are the other pages of your site working? Is it just this one that you're having trouble with?
I am having error in this page only Idk why it logs the error in the console where it just works perfectly in the browser like there is image in video of silver-necklace it complains me about it in the console but in browser it just works perfectly fine and... after sometime it complians me about .getByUID isn't a function
This video will explain everything you need to know from what i am sufferin
and because of this error i not able to fetch the image of the silver necklace to the collections page
Alright so if I understand correctly, everything is working and displaying correctly on the site. It's just giving strange errors in the console?
The video is a little hard to see, can you send me the pug file for this page? Or even better, can you send me the entire project so I can test it here? You can either send me a zip file of the project or a link to Github (or similar).
@ojasshukla211 I've taken a look and found a solution for you. I'm still not sure why this is happening, but I found that if you do a check to make sure that product exists before rendering the page, then the error messages don't appear. You could create a 404 page to display in the case that there isn't a document in Prismic to match the page. Something like this:
I not get those type of error anymore but I do get this one
[0] Error: Failed to lookup view "./error_handlers/404" in views directory "/Users/desartist22/Desktop/floema/views"
[0] at Function.render (/Users/desartist22/Desktop/floema/node_modules/express/lib/application.js:580:17)
[0] at ServerResponse.render (/Users/desartist22/Desktop/floema/node_modules/express/lib/response.js:1012:7)
[0] at /Users/desartist22/Desktop/floema/app.js:86:21
[0] at processTicksAndRejections (internal/process/task_queues.js:95:5)
getting this error is like normal or still a error to solve?
thanks tho those errors aren't coming so thankyou so much i grateful for this
and yessss its solve the error i was getting in collections page thankyou i think getting this error is like normal thankyou thankyou so much man you are master
Yes, that error is normal. You'll need to create a 404 page that you display if there is no product. If you want to quickly get rid of the error then replace
res.status(404).render("./error_handlers/404");
with
res.status(404).send('Page not found');
system
(system)
closed as resolved, flag & select 'Something Else' to reopen.
17
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.