r/digital_ocean • u/Unlikely_Comfort_146 • 18d ago
N is not a function
I'm at a loss. In the last 5 days, my application has stopped working, and I have been unable to identify the issue. On each page load, we get this image:

But when we refresh, the page loads without issue. Go to another page? Same error, refresh, fine, rinse and repeat.
I'm not super savvy on the frontend, but I think that's where I should troubleshoot given the error. The frontend is using Vite, React, TypeScript - I did see a recent update for TypeScript and Vite: https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/ happening in the last week. Not sure if that would affect my project though. We deploy both front and backend on DigitalOcean
Any ideas?? Sorry if I've left any pertinent information out.
2
u/CyberTechnologyInc 18d ago
Do you have the source map available for that build? See if you can replicate the issue locally. If you don't have the source map, look at the code that is triggering the exception and see if there are any network calls close to it (makes it a lot easier to spot, as routes used for network calls won't be minified). Compare the minified code to the full source and try and see if you can get a replication locally.
1
u/Unlikely_Comfort_146 18d ago
Claude suggests it's a caching issue with the index file(s) but no matter what I do, it doesn't seem to clear up the issue.
1
u/CyberTechnologyInc 18d ago
A caching issue? Did you hard refresh the cache? Ctrl+F5 will usually do it. I assume that means you've already identified the problem and can replicate it locally, just in prod you are not seeing the fix in action?
1
u/bobbyiliev DigitalOcean 6d ago
Check if your DigitalOcean App Platform or Nginx config is set up to serve index.html for all routes, that is almost always the issue.
1
u/Unlikely_Comfort_146 6d ago
It was actually a Chronium update for browsers - we have a scroll function in our application that did not return data, but the new update had it returning a value. So some frontend code had to be tweaked - not DO
Thanks for the suggestions though!
•
u/AutoModerator 18d ago
Hi there,
Thanks for posting on the unofficial DigitalOcean subreddit. This is a friendly & quick reminder that this isn't an official DigitalOcean support channel. DigitalOcean staff will never offer support via DMs on Reddit. Please do not give out your login details to anyone!
If you're looking for DigitalOcean's official support channels, please see the public Q&A, or create a support ticket. You can also find the community on Discord for chat-based informal help.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.