Relative Content

Tag Archive for arraysnext.jstsx

Error: undefined (reading ‘map’). Using && Success to compile but no array displayed

I’m a new student of next-js, I currently learning on database/calling arrays.
I have this files structure & script (in this image) trying to call arrays from /data.

The problem with this script is, it is pointing Error: Cannot read properties of undefined (reading 'map') to .map.

My question is, what is wrong with the script?

And then, there are some solution I read from the community to add && or id?.map.

So I try to use newlink && newlink.map and newlink?.map for my script. The result is, yes it fix the script to be able to compile, but there is no arrays displayed.

How to fix this error?

Error: undefined (reading ‘map’). How to display arrays using Array in next-js?

I’m a new student of next-js, I currently learning on database/calling arrays.
I have this files structure & script (in this image) trying to call arrays from /data.

The problem with this script is, it is pointing Error: Cannot read properties of undefined (reading 'map') to .map.

My question is, what is wrong with the script?

And then, there are some solution I read from the community to add && or id?.map. So I try to use newlink && newlink.map and newlink?.map for my script. The result is, yes it fix the script to be able to compile, but there is no arrays displayed.

How to fix this error?

Error: undefined (reading ‘map’). Using && Success to compile but no array displayed

I’m a new student of next-js, I currently learning on database/calling arrays.
I have this files structure & script (in this image) trying to call arrays from /data.

The problem with this script is, it is pointing Error: Cannot read properties of undefined (reading 'map') to .map.

My question is, what is wrong with the script?

And then, there are some solution I read from the community to add && or id?.map.

So I try to use newlink && newlink.map and newlink?.map for my script. The result is, yes it fix the script to be able to compile, but there is no arrays displayed.

How to fix this error?