Unable to load my new plugin, getting 'Uncaught (in promise) SyntaxError: Unexpected token '<'

I created a prototype layout using the app-basic example as a starting point. I was able to run it locally with ‘yarn dev’ on my personal Mac but now I’m trying to run it in my work VDI using docker-toolbox with our stock Grafana 7.2.1 image as a base. I am mounting my project ‘dist’ folder properly and Grafana detects the new plugin (it appears in the list under plugins as ‘unsigned’) however, when I click on it, it just says ‘Loading…’ and the console shows an 'Uncaught (in promise) SyntaxError: Unexpected token ‘<’. This error is undoubtedly due to the response being the error HTML stating “If you are seeing this Grafana has failed to load its application files…”. I’m setting the GF_DEFAULT_APP_MODE=true and GF_PLUGINS_ALLOW_LOADING_UNSIGNED_PLUGINS=my-plugin. I’ve read somewhere that this can be caused by Grafana not loading some required dependency package(s) however, I don’t see an errors when I do ‘yarn install’ and ‘yarn dev’/‘yarn build’ (there are a few warnings though). If someone could please give some advice as to how I can troubleshoot this further to get to the root cause, it would be greatly appreciated.

Thank you in advance,


*** UPDATE ***

I rebuilt my project from scratch, this time using the deprecated GitHub - grafana/grafana-starter-app: Template for grafana app plugins as a starting point and was able to load it properly on first try. Not sure what the difference is but I’m guessing some of the older packages work better with our current environment.

1 Like

The lack of insight into these SystemJS errors is quite frustrating. For me, the issue was an outdated dependency used by a library I was adding. I basically went through my dependencies one by one, commenting out imports until my app built successfully.

1 Like