Support Forums

Data in useEffect react app not rendering

Hi all, please help! I have a react app which uses a for loop in UseEffect() to find a questions object in a json file based on a parameter. It then loads the data in the render function and it works fine in my localhost but it is not rendering any data in prod on Netlify, any help would be appreciated! The site is: https://learn-anesthesia.com/. If you click on one of the modules for example the cards don’t work:
Home | Learn-Anesthesia.

Github repo: https://github.com/vsahinid/learn-anesthesia.com

hi @vsahinid - sorry to be slow to reply. This sounds frustrating. I am not sure i quite understand what you are trying to do, but have you checked to see whether the paths are changing (maybe due to asset optimization, or something in your build settings?) or whether this is case issue?

I am having a similar issue. When I have a useEffect statement I get an error

TypeError: Object(…) is not a function

My page does not ever load any of the console.log messages. If I remove the useEffect the page loads fine and all console messages appear along with the text in the browser.

My issue has been resolved. The problem was with the following statement
import { useEffect } from ‘react/cjs/react.development’
it should have been
import { useEffect } from ‘react’
The perils of auto import