I am facing a syntax error in my Rails application, specifically in a large JS file that seems to be generated by webpacker. The error appears to be related to Angular/Material code. Interestingly, when I exclude material design, the error disappears. Here is the problematic section of code:
function instantiateSupportedAnimationDriver() {
return !(function webpackMissingModule() { var e = new Error("Cannot find module '@angular/animations/browser'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())() ? new !(function webpackMissingModule() { var e = new Error("Cannot find module '@angular/animations/browser'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())() : new !(function webpackMissingModule() { var e = new Error("Cannot find module '@angular/animations/browser'"); e.code = 'MODULE_NOT_FOUND'; throw e; }())();
}
It is worth noting that providing a solution to fix the syntax error may not be helpful as I do not have control over this code. Additionally, it is widely used, so the error may not be in the code itself but rather in the setup.
Some background information: I am exploring the integration of Rails + Webpacker + Typescript + Angular + Material, which is proving to be quite challenging. There is limited information available online on this specific setup, and I may be one of the first to attempt it. While some suggest creating an API-only Rails app, I am hesitant to go down that route...