-
-
Notifications
You must be signed in to change notification settings - Fork 225
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 read property 'add' of undefined #974
Comments
I have the same error with this code:
|
The issue seems to be with default functional parameters set to a constant. |
Seeing the same problem here... setting |
Also, seems there is a similar old issue : #556 |
I see the same issue when using
|
Same issue here. |
same issue here :( |
Same issue here to build webtorrent |
I'm having the same issue when I'm assigning a default value to a parameter. As soon as I remove the default value, the issue is gone. |
Same issue |
I have noticed a weird behaviour :
I think this means the issue is caused by one of |
Same issue here. |
same issue :( |
Same for me on both babel-preset-minify 0.4.3 and 0.5.1. This doesn’t compile: import { doc } from '../utils/Document';
const DEFAULT_DEBOUNCE_DELAY = 100
let resizeTimer = null
export default function debounceResize(callback, delay = DEFAULT_DEBOUNCE_DELAY) {
clearTimeout(resizeTimer)
doc.classList.add('resizing')
resizeTimer = setTimeout(() => {
doc.classList.remove('resizing')
callback()
}, delay)
} Stack trace:
This compiles properly: import { doc } from '../utils/Document';
let resizeTimer = null
export default function debounceResize(callback, delay = 100) {
clearTimeout(resizeTimer)
doc.classList.add('resizing')
resizeTimer = setTimeout(() => {
doc.classList.remove('resizing')
callback()
}, delay)
} |
I'm still stuck on @babel/core@7.5.5 because of this. Any way we can help fix this ? |
I was able to work around this problem by using |
Babel has this bug which appeared after trying to update to the latest version, and remained even after rolling back to an older version. Extremely annoying. babel/minify#974 Add grunt-terser. Remove babel, core-js, lodash, which was used just once in build-popup.js, and react-virtualized, which wasn't used at all. Remove package-lock.json from .gitignore and commit it, to make it easier to track exact package changes.
I was seeing the same thing as @arantes555, where upgrading to the latest package started causing the issue, but rolling back to the previously working version still produced the bug, even after wiping and reinstalling |
@fwextensions I ended up switching to terser too... For those who, for some reason, cannot switch, the trick in this case is to wipe node_modules, and roll-back both your package.json and pacakge-lock.json, then re-installing. |
I got same error. |
Fix #57. Squashed commit of the following: commit d10eca3 Author: John Dunning <fw@johndunning.com> Date: Tue May 4 15:54:50 2021 -0700 Update version to 1.6.1 Update README.md, releases/index.md and the store descriptions to include the new keyboard shortcuts. commit 1852914 Author: John Dunning <fw@johndunning.com> Date: Thu Apr 29 12:39:39 2021 -0700 Add IsLinux constant Use ctrl-alt-W on Linux/ChromeOS for closing a tab in the menu, since ctrl-W is intercepted by the browser. commit 12809d5 Author: John Dunning <fw@johndunning.com> Date: Tue Mar 30 12:09:29 2021 -0700 Update dependencies to the latest commit ce05780 Author: John Dunning <fw@johndunning.com> Date: Mon Mar 29 11:29:26 2021 -0700 Add ctrl-P/N and ctrl-K/J shortcuts for moving up/down Fix error in error-handler.js. :| Let newer key bindings override older ones with the same shortcuts. commit 03a044f Author: John Dunning <fw@johndunning.com> Date: Sun Mar 28 17:27:40 2021 -0700 Switch to using terser instead of babel Babel has this bug which appeared after trying to update to the latest version, and remained even after rolling back to an older version. Extremely annoying. babel/minify#974 Add grunt-terser. Remove babel, core-js, lodash, which was used just once in build-popup.js, and react-virtualized, which wasn't used at all. Remove package-lock.json from .gitignore and commit it, to make it easier to track exact package changes. commit e6efa20 Author: John Dunning <fw@johndunning.com> Date: Sat Mar 27 18:06:55 2021 -0700 Fix build-popup.js Change npm build to run grunt build.
Any update? Seem there is an PR checked but not merged. |
Confirming it works with @babel/plugin-transform-parameters Thank you very much @s100 |
Any update? I found that it started to fail after a change in |
seeing " Cannot read property 'add' of undefined" with the latest
sample code, junk.js
command: npx babel junk.js --presets=minify
package.json
stack
The text was updated successfully, but these errors were encountered: