CodeWithHarry / iNotebook-React

INotebook is a React Application for managing personal notes on the cloud
344 stars 194 forks source link

After 72 video. ERROR: notes.map is not a function. Please Help #22

Open vaibhavthakurs opened 2 years ago

vaibhavthakurs commented 2 years ago

Please help.! After changing hard code auth token from localStorage, i am getting an error : notes.map is not a function. i have replace 'token' from 'auth-token' in all code after getting someone's comment. But it is not working for me.!! PLease Help!!

ayushj02 commented 2 years ago

Also I Need a solution for this pls help!

vaibhavthakurs commented 2 years ago

Also I Need a solution for this pls help!

Please check in your network are you getting a token or authToken? Check all your spelling of authtoken or its authToken in your code. You can continue with (token), there is no need to change that, i had completed my project with the same

ayushj02 commented 2 years ago

Also I Need a solution for this pls help!

Please check in your network are you getting a token or authToken? Check all your spelling of authtoken or its authToken in your code. You can continue with (token), there is no need to change that, i had completed my project with the same

Thanks Bro It Worked!

vipulsuthar011 commented 2 years ago

Also I Need a solution for this pls help!

Please check in your network are you getting a token or authToken? Check all your spelling of authtoken or its authToken in your code. You can continue with (token), there is no need to change that, i had completed my project with the same

Thanks Bro It Worked!

can you please tell me how i am getting the same error please help me bro

Soulpurr commented 2 years ago

Also I Need a solution for this pls help!

Please check in your network are you getting a token or authToken? Check all your spelling of authtoken or its authToken in your code. You can continue with (token), there is no need to change that, i had completed my project with the same

Thanks Bro It Worked!

can you please tell me how i am getting the same error please help me bro

check for spell error in authtoken whether u have named it as authToken or authtoken in your backend

wethecoderz commented 2 years ago

write this 'notes || notes.map((note)' instead of 'notes.map((note)'.

vkvikas01 commented 1 year ago

I write this " "auth-token": localStorage.getItem('auth-token') " and it will gave error "notes.map is not a function" after that I check in network where " auth-token: undefined " can anyone please help me to fix it.

FireWarrior22 commented 1 year ago

I write this " "auth-token": localStorage.getItem('auth-token') " and it will gave error "notes.map is not a function" after that I check in network where " auth-token: undefined " can anyone please help me to fix it.

change authtoken in the auth.js file to token. Change every occurence of authtoken to token present in the backend file and remove the hard coded auth-token value from thunder client's header

Ashwani2529 commented 1 year ago
{Array.from(notes).map((note) => { return ( ); })}
ZAIN-BUKHARI commented 1 year ago

getitem I small rakho

On Thu, Mar 23, 2023, 3:04 PM Bhargav Reddy @.***> wrote:

I write this " "auth-token": localStorage.getItem('auth-token') " and it will gave error "notes.map is not a function" after that I check in network where " auth-token: undefined " can anyone please help me to fix it.

change authtoken in the auth.js file to token. Change every occurence of authtoken to token present in the backend file.

— Reply to this email directly, view it on GitHub https://github.com/CodeWithHarry/iNotebook-React/issues/22#issuecomment-1480909552, or unsubscribe https://github.com/notifications/unsubscribe-auth/A23X73KUL4W4FLEGYKYITXDW5QNZPANCNFSM5MZ4N2HA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Soulpurr commented 1 year ago

Check whether you are receiving notes as a object or an array? Most probably it's a object that's why error is coming

ZAIN-BUKHARI commented 1 year ago

If object then use {Object.keys(notes).map((Note)=>{ )}}

On Sat, May 27, 2023, 7:15 AM ABHISHEK @.***> wrote:

Check whether you are receiving notes as a object or an array? Most probably it's a object that's why error is coming

— Reply to this email directly, view it on GitHub https://github.com/CodeWithHarry/iNotebook-React/issues/22#issuecomment-1565161087, or unsubscribe https://github.com/notifications/unsubscribe-auth/A23X73KH32MOKAXCDHE65HDXIFPSXANCNFSM5MZ4N2HA . You are receiving this because you commented.Message ID: @.***>

BlackHat0108 commented 11 months ago

Please help.! After changing hard code auth token from localStorage, i am getting an error : notes.map is not a function. i have replace 'token' from 'auth-token' in all code after getting someone's comment. But it is not working for me.!! PLease Help!!

I am facing the same issue I am getting token in the network

ramshahu commented 11 months ago

check your auth.js file and fetchuser.js file in backend. you might have written auth-token. simple write auth-token instead of token in localStorage.getItem('auth-token') in NoteState.js,login.js,signup.js.,Notes.js and Navbar.js. Also replace the json.authtoken with authToken in Login.js and Signup.js. hope this will help you