is not working in react build

What is wrong with my code?
I have used method on an array of objects.
it works well in local environment but it dose not work in react build

app link -

repo link - GitHub - rushikemble/shopList

When you have a problem, please do some detective work.

When I go to your app link, I see this in the console:

react-dom.production.min.js:216 TypeError: is not a function
at y (HomePage.js:109)

When I go to HomePage.js:109, I see:

{ => {

What is filterData? It is an object. It gets initialized with shops. When I log that out it is an object. When I log out filterData, it is always an object.

The error is occuring because objects to not have a map property or method so you are trying to run undefined as a function. That is a big no-no. This is what the error “ is not a function” is trying to tell you.

You need to figure out what that data should be and what shape it should have.

I’m sorry to pick on you here, but it’s a little bit unfair to just say “here is a complicated application using various libraries with the code split across a load of files, it’s broken, what’s wrong with it” and expect people to debug the application for you.

Please be more specific when asking questions. It’s much easier to show this on something like CodeSandbox, but if you’re showing code that’s on GH at least say which file, what the error is, what you’re trying to do, what’s not happening that you expect to happen.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.