score:-1
i was facing this issue and it got resolved just by following the steps:
if you are trying to open the html directly without any web server then useeffect won't be called.
only way to solve this issue is by running a webserver and serve the html from the server.
i am using a mac system so run the python server using the command inside the public folder:
python -m simplehttpserver 8000
then open it using localhost:8000
score:0
i think what is happening is that the gsap library is getting tree shaken out of the production build. i would either try adjusting your webpack settings to make sure that it is not removed, or include it like this instead:
const gsap = require("gsap")
which in my experience has prevented libraries from being tree shaken out.
Source: stackoverflow.com
Related Query
- Gatsby not loading useEffect function in production
- How to call loading function with React useEffect only once
- Uncaught TypeError: create is not a function using useEffect React Hook with AJAX request
- Error while loading rule 'prettier/prettier': context.getPhysicalFilename is not a function
- useEffect cleaning function is not called when tab is closed
- Not able to mock a function inside useEffect
- React Hook does not work properly on the first render in gatsby production mode
- TypeError: destroy is not a function in useEffect caused by async/await
- Function call inside useEffect not firing in jest test
- function inside useEffect not getting called for deepLink
- Webpack file-loader not loading assets folder in production build
- useEffect function is not called
- User defined function call on useEffect not rerturing correct output
- Async function not waiting for results even when used inside useEffect with await
- useEffect cleanup function Typescript error: not assignable to parameter of type 'EffectCallback'
- Dependencies in React useEffect cleanup function are not updated
- spread operator not working in nested setState within useEffect using .map() function
- Gatsby Starter Blog images not loading
- React useEffect can not update function variables
- Type Error : destroy is not a function in Reactjs while call api async function in useEffect hook
- Function not loading inside componentDidMount ()
- Cookies are not loading first time in Gatsby with gatsby-plugin-gdpr-cookies and react-cookie-consent
- Async Fetch function not being called in useEffect
- Gatsby / React map is not a function (with example sandbox)
- My variable has not updated yet when I create my onClick function since useEffect is run last
- GSAP Animations not loading in production
- React Next.js not calling useEffect hook in production app
- pages.map is not a function in gatsby nodejs using axios to fetch data
- State variable inside a function defined within useEffect hook is not updating when value changes
- Sharpspring script not loading consistently on a Gatsby page
More Query from same tag
- TypeError: cache.writeData is not a function --> apollo-link-state
- React: How to pass width as a prop from the component
- How to set display name for a React class (ES6)?
- Is there a way to link non-react html files in a react app?
- TypeError: Cannot read property '0' of undefined json react-js
- problem with rendering components wrapped in table
- Do you need to add ...restProps for compound components in react?
- .then promise not working within axios delete request in react application
- How to center a button in Material-UI
- Refactoring a React component for reuse
- Add property to React Typescript Interface
- backgroundImage is not working react, just the default white background
- React Flow - How to use data in Edge With Button?
- How to set the handler for multiple checkboxes in react?
- Redux: Accessing current state - best practice?
- how to resize Base64 image in javascript
- React Router history.push is updated when I scroll through images inside the component, but the route doesn't actually change
- Passing CORS when resource lacks access-control-allow-origin header
- Find all occurrences (letters) in array (word)
- React router not reloading data
- Button onSubmit undefined state
- Need help to fetch API
- React Antd: How to remove spacing between vertical divider and any content right next to it?
- Webdriver-io Component not found after route navigation
- REACT.JS - how to update multiple children on parents state change by one of children
- Optimize the function in React. Having setState key as a props?
- React JS: Correct way to redirect from one component to another on URL click
- how i fix Cannot use 'in' operator to search for '1' in undefined in react?
- Best way to handle useRef(null) in typescript
- How do i combine Selector with my Utility function?