Closed screamff closed 2 years ago
I have this issue too.
I tried to copy the code, running the package through the command pallette. It brought the error @screamff also had.
I have this also--working on Mac...
I have this issue too. Mine is windows 7 enterprise.
I have this issue too on Linux, Fedora 27.
I'm facing this issue too, on Ubuntu
I'm having this issue too on windows 10
Uncaught TypeError: Cannot read property 'length' of undefined
C:\Users\Jordi\.atom\packages\copy-with-style\lib\atom_editor.js:21
Hide Stack Trace
TypeError: Cannot read property 'length' of undefined
at new Editor (file:///C:/Users/Jordi/.atom/packages/copy-with-style/lib/atom_editor.js:21:53)
at RTFgenerator.generate (file:///C:/Users/Jordi/.atom/packages/copy-with-style/lib/rtf_generator.js:47:5)
at Object.copy (file:///C:/Users/Jordi/.atom/packages/copy-with-style/lib/main.js:56:67)
at HTMLElement.copyWithStylePreset1 (file:///C:/Users/Jordi/.atom/packages/copy-with-style/lib/main.js:19:45)
at CommandRegistry.handleCommandEvent (C:\Users\Jordi\AppData\Local\atom\app-1.27.2\resources\app\src\command-registry.js:384:49)
at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (C:\Users\Jordi\AppData\Local\atom\app-1.27.2\resources\app\node_modules\atom-keymap\lib\keymap-manager.js:621:22)
at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (C:\Users\Jordi\AppData\Local\atom\app-1.27.2\resources\app\node_modules\atom-keymap\lib\keymap-manager.js:412:28)
at WindowEventHandler.handleDocumentKeyEvent (C:\Users\Jordi\AppData\Local\atom\app-1.27.2\resources\app\src\window-event-handler.js:110:40)
Go to the settings of the add-on, and click "View code".
Go to the lib -> atom_editor.js file
Change line 21 to this.lines = new Array( this.editor.buffer.getLines().length );
Save the file
Close all your Atom windows and re-open them.
This will fix the .length() issue but now there is another issue with "onDidUpdateState" being called on null because "component.presenter" on line 58 of the atom_editor.js file is deprecated and so presenter is undefined, thus presenter.onDidUpdateState() will not work.
I'm having this error too on MacOS High Sierra 10.13
I get this issue as well. I've edited line 21 based on @milan102 suggestion and commented out lines 59, 62 that were throwing more errors, but now the command does nothing (nothing gets copied to Clipboard)
I'm on Win10.
Same problem here on mac OSX, change in line 21 didn't fix the error.
Same problem on Windows 10. Change in line 21 didn't help.
Ditto, on Win 10, changed line 21, no change.
Same issue here on mac os. Atom 1.41.0
Same issue here on macOS Big Sur (11.2.3), Atom 1.58.0 Changing line 21 causes Issue #13
[Enter steps to reproduce:]
Atom: 1.22.1 ia32 Electron: 1.6.15 OS: Unknown Windows version Thrown From: copy-with-style package 1.1.0
Stack Trace
Uncaught TypeError: Cannot read property 'length' of undefined
Commands
Non-Core Packages