hydra-synth / atom-hydra

78 stars 29 forks source link

Uncaught ReferenceError: range is not defined #66

Open lwlsn opened 5 months ago

lwlsn commented 5 months ago

I've tried package installs for hydra in Pulsar using both ppm and npm following the latest instructions on the Readme.

This error appears when evaluating code in the editor:

Uncaught ReferenceError: range is not defined. 

ReferenceError: range is not defined
    at Main.evalCode (main.js:80:12)
    at HTMLElement.atom-hydra:evalCode (atom-hydra.js:21:46)
    at CommandRegistry.handleCommandEvent (/Applications/Pulsar.app/Contents/Resources/app.asar/src/command-registry.js:405:43)
    at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Pulsar.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:617:16)
    at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Pulsar.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:408:22)
    at WindowEventHandler.handleDocumentKeyEvent (/Applications/Pulsar.app/Contents/Resources/app.asar/src/window-event-handler.js:153:34)

This is the eval-code is keymapped and producing the error

evalCode() {
let editor
if (editor = atom.workspace.getActiveTextEditor()) {
range = {
start: { row: 0, column: 0 },
end: { row: editor.getLastScreenRow() + 1, column: 0 }
}
this.evalFlash(range);
this._eval(editor.getText());
}
}

Any suggestions as to what's going on here?

I'm running on a Mac M3

lwlsn commented 5 months ago

Logged an issue in pulsar but it looks like it might be package specific?

https://github.com/pulsar-edit/pulsar/issues/969

ojack commented 5 months ago

What is the code you are evaluating?

On Sun, Apr 14, 2024, 11:44 Lizzie @.***> wrote:

Logged an issue in pulsar but it looks like it might be package specific?

pulsar-edit/pulsar#969 https://github.com/pulsar-edit/pulsar/issues/969

— Reply to this email directly, view it on GitHub https://github.com/hydra-synth/atom-hydra/issues/66#issuecomment-2054131761, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABFOVSKNEG5VJTSKBJ2HADTY5K573AVCNFSM6AAAAABGGILQ4WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJUGEZTCNZWGE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

lwlsn commented 5 months ago

Ah apologies- The package toggles on/off; but then when you evaluate any code in the editor Pulsar throws this error.

I've made sure to install via the readme instructions, and also tried a npm install and still get the same error :/

lwlsn commented 5 months ago

so even just osc().out() would throw this