0

I'm having an issue when deploying a React/Redux site to Azure App Service. It builds and deploys fine, but when visiting the site I get JS errors for babel-polyfill - Uncaught TypeError: define is not a function.

We're using webpack with a few loaders and there is one in particular that I have a feeling could be the problem - imports-loader. We had it set as use: 'imports-loader?define=>false' which I believe overrides the define method. I tried this as true also but with no affect. I tried removing the define=>false altogether and the whole build broke... See webpack config here.

Advice much welcome!

Cheers Dave

Dave C
  • 457
  • 3
  • 10
  • Why are you using `imports-loader` there in the first place? – loganfsmyth Feb 02 '18 at 16:28
  • We picked up a pre-made template that used it and haven't looked at removing it. It may be a possibility though if it is giving this much grief! – Dave C Feb 05 '18 at 09:33
  • Changed the build agent on VSTS to a MacOS agent as opposed to windows that it was using and it fixed the error. Also removed the imports-loader as it wasn't really being used so that's another nightmare removed! Cheers – Dave C Feb 05 '18 at 10:39

0 Answers0