Android whitescreen Uncaught Error: Cannot find module "."

I’m getting this error when I try to emulate in Android Studio or build the app for running on a device. It’s not a very helpful message, so it’s causing me a massive problem trying to figure out what is causing it.

As soon as the this message appears, the app displays a whitescreen and freezes.

I’ve spent many days and tried many solutions trying to get this working, but still can’t find a way around it, so I’m hoping someone on here can help.

My project is on the latest ionic, cordova and plugin versions as at 2019/06/03 (I also tried rolling everything back to several previous versions to no avail).

ionic cordova build android, works with no errors, but when I do a run in Android Studio, Uncaught Error: Cannot find module “.”, appears in the logs.

I’ve compared the logs to a known good log of the same app and this is the only difference, so I have to conclude that whatever is causing the problem is also producing this message.

OS: MacOSX Mojave 10.14.5
Android Studio: 3.4.1
Gradle: 5.4.1
Android Gradle: 3.4.1
Build Tools: 28.0.3
Compile SDK: 28
Java: 1.8

Log messages before and after the error message:

D/LaunchNavigatorPlugin: Plugin action=discoverSupportedApps
I/ShortcutBadger: Checking if platform supports badge counters, attempt 1/3.
I/ShortcutBadger: Badge counter is supported in this platform.
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
    (HTTPLog)-Static: isSBSettingEnabled false
D/SystemWebChromeClient: http://localhost/build/vendor.js: Line 31978 : Uncaught Error: Cannot find module "."
I/chromium: [INFO:CONSOLE(31978)] "Uncaught Error: Cannot find module "."", source: http://localhost/build/vendor.js (31978)
D/SystemWebChromeClient: http://localhost/build/vendor.js: Line 143289 : Ionic Native: deviceready event fired after 46 ms
I/chromium: [INFO:CONSOLE(143289)] "Ionic Native: deviceready event fired after 46 ms", source: http://localhost/build/vendor.js (143289)
D/CordovaWebViewImpl: onPageFinished(http://localhost/)
D/SERVER: Handling local request: http://localhost/assets/icon/favicon.ico
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
    (HTTPLog)-Static: isSBSettingEnabled false
I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
    (HTTPLog)-Static: isSBSettingEnabled false

Can anyone suggest what could be causing this error?