Published on

Solution for “ReferenceError: util$4 is not defined” for Svelte apps

Problem: Running into "ReferenceError: util$4 is not defined" error for Svelte apps. Here is a screenshot:

Error screenshot

Figure 1: Error screenshot

Solution: Change the installed version of the svelte package to something other than the existing version. The specific version to be installed doesn't really matter, experiment with some versions and that should solve this error. Here is the npm command to install a different version:

npm install svelte@3.3.9
// or
npm install svelte@3.3.2

Conclusion

Thanks for reading this blog post!

If you have any questions or concerns please feel free to post a comment in this post and I will get back to you when I find the time.

If you found this article helpful please share it and make sure to follow me on Twitter and GitHub, connect with me on LinkedIn and subscribe to my YouTube channel.