0

I am manually uploading a bundle file into an Azure Web App Service using Kudu. I usually deploy it automatically, but I have received a notice that the site is not working due to an unexpected character in the Bundle JS file. Surprisingly, the file becomes "corrupt" also when I upload it by hand.

The Bundle is generated by Webpack and these are the relevant lines:

/***/ (function(module, exports) {
angular.module("dirApp").factory("userService", function ($http, $q, dirConfig) {
    var f = this;

But when I upload it, the file becomes:

/***/ (function(module, exports) {
angular.module("dirApp").factory("userService", function ($http, $q, dirConfig) {
    var f = this;

Note the strange characters before angular.module

I'm sure the original file does not have these strange chars before uploading. If I compare the file in my repository with the one on the server, the comparer tool shows exactly these characters as the only difference in a couple of places inside the bundle file.

EDIT:

  • When I generate the file using Webpack, the contents are right
  • When the file is copied to the deploy server, the strange chars appear

Why is this happening? If it were generated by Webpack, I could add a loader to remove it, but since Webpack is doing ok, I don't have a clue... also, how it was working fine with daily deploys during six months until now? - is something that makes me crazy

zameb
  • 705
  • 11
  • 26
  • 1
    You need to strip byte order markers. https://stackoverflow.com/a/3256014/3092540 – Greenbeard Dec 02 '17 at 02:43
  • Thanks, I see... now I'm looking for a way to do it automatically, or how to avoid it to happen in the last stage of copying the file to the server. Any help is welcome – zameb Dec 02 '17 at 02:56

0 Answers0