Vue-dropzone: Uncaught TypeError: Cannot read property 'status' of undefined

Created on 24 Jun 2017  路  6Comments  路  Source: rowanwins/vue-dropzone

Hi,

When running gulp-production we are getting this error, in development mode it works fine.

Most helpful comment

I just ran into this issue as well with Elixir. It's being caused by uglifyjs incorrectly mangling a line of the dropzones source in dist/vue2-dropzone.js

In my case I added the mangle properly to the elixir config to exclude the offending variable name. It's a bit hacky but it works.

Here's the line in vue2-dropzone that was causing the error for me -

e[0].status!==t.CANCELED&&4===B.readyState

Uglify was converting the e[0] to r[0] which is what was causing the error.

My fix:

elixir.config.js.uglify.options = {
  compress: {
    drop_console: elixir.inProduction,
  },
  mangle: {
    except: ['e']
  }
}

All 6 comments

Hey @azhard4int , please can you explain how are you doing in development? I would suggest to follow https://github.com/rowanwins/vue-dropzone#development this steps. Just need to know what exactly you are doing (some steps) so I can better assist your issue.
Thanks

I am using gulp along with laravel, everything run fine in the watch mode. When we run the gulp in production the error comes up. It only happens due to the minified verison.

I have just used the non-minified version in my project and ran the gulp in production mode it works fine so far.

@azhard4int I believe this error is not related to vue2-dropzone. For more I'll suggest you need to dig into stacktrace to verify which module/library/component is responsible for this issue.

Gday @azhard4int

Im going to close this issue as it's likely to do with the gulp minification process.

Depending on which gulp minifiers you are using sometimes they can do some strange things so perhaps try swapping to a different minifier, or adjusting the settings on the one you are using. Posting info about the error you are recieving might enable someone to provide further assistance.

I just ran into this issue as well with Elixir. It's being caused by uglifyjs incorrectly mangling a line of the dropzones source in dist/vue2-dropzone.js

In my case I added the mangle properly to the elixir config to exclude the offending variable name. It's a bit hacky but it works.

Here's the line in vue2-dropzone that was causing the error for me -

e[0].status!==t.CANCELED&&4===B.readyState

Uglify was converting the e[0] to r[0] which is what was causing the error.

My fix:

elixir.config.js.uglify.options = {
  compress: {
    drop_console: elixir.inProduction,
  },
  mangle: {
    except: ['e']
  }
}

Thanks for the tip @stoked74

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zhangzhen picture zhangzhen  路  3Comments

stevenhardy-digital picture stevenhardy-digital  路  4Comments

kyoukhana picture kyoukhana  路  5Comments

ServerJunge picture ServerJunge  路  5Comments

hubertokf picture hubertokf  路  4Comments