Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot assign to read only property 'currentTarget' of object '#<MouseEvent>' #171

Open
WeijianXu opened this issue Mar 20, 2017 · 2 comments

Comments

@WeijianXu
Copy link

I got this error message when I used webpack2 to pack my code include x-tag. The detail is:
return i.stack = function(e) { e.currentTarget = e.currentTarget || this; var t = e.detail || {}; return t.__stack__ ? t.__stack__ == a ? (e.stopPropagation(), e.cancelBubble = !0, a.apply(this, arguments)) : void 0 : a.apply(this, arguments) }
this line e.currentTarget = e.currentTarget || this; throwed this error. why cann't it assign to read?
My package.json:
"devDependencies": { "extract-text-webpack-plugin": "^2.1.0", "html-webpack-plugin": "^2.28.0", "webpack": "^2.2.1", "webpack-livereload-plugin": "^0.10.0" }

@WeijianXu
Copy link
Author

when I modified the code e.currentTarget = e.currentTarget || this; to this:
if (!e.currentTarget) { e.currentTarget = this; }. It worked well.

@johnsto
Copy link

johnsto commented Apr 1, 2017

FYI I'm encountering this error with similar code using Rollup.js w/Babel, so it's not Webpack-specific.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants