Lazy / Suspense issue in local environment


I am using dynamic imports for a web app that I have built, where I am receiving the error in the screenshot.

The interesting thing about this error, is that everything works fine in production, it also works fine on localhost:3000, the only time this happens is if I connect to it locally to test from another device, i.e. [IPaddress]:3000

This has made figuring out the problem very tricky, as the fact that it works everywhere else would suggest that I have set it up correctly. Also noting that the web app loads fine on [IPAddress]:3000 until I get to a page that uses Lazy/ Suspense to import a component

Has anyone run into this issue before when using React Lazy / Suspense?

You should set ROOT_URL env var using your Public IP Address.

1 Like

That worked! Thank you very much Filipe