Hyper: Error on trying to edit preferences

Created on 11 May 2017  路  19Comments  路  Source: vercel/hyper

When I go to Men煤 --> Edit --> Preferences, I'm getting the following message:

Error: 'module' is not defined.

Please see the attached image for more info.
Thanks.
image

-

Hyper 1.3.2
Electron 1.4.16
win32 x64 6.1.7601

help wanted High Windows

Most helpful comment

Workaround:

  1. find a random .js file on your computer.
  2. right click it, choose "Open with" > "Choose another app".
  3. choose an editor from the list that works for you (VSCode etc) and check "Always use this app to open .js files".

This will re-associate .js files with an editor instead of trying to execute it. Settings should open in this editor the next time you try it (CTRL+,).

All 19 comments

I'm having a similar issue when I try to open up preferences.

screen shot 2017-05-11 at 11 58 15 am

Hyper 1.3.2
macOS 10.12.1

For you both, it seems to be a problem with your native editor: Microsoft JScript and Emacs. Please be sure to have a proper software assigned to open .js file.

OMG... Maybe Windows try to execute js file and not to open it @JorgeSilvaBorda .
I'll try to investigate further

Yes, I believe this is what actually happens.

If .js files are re-associated with an editor (as the default "open" action, not "edit") then that editor is started.

@chabou jscript isn't a native editor -- it's what windows tries to run .js files with by default. This is happening when trying to open preferences up.

My editor of choice is vim, which runs in the terminal, so I have no windows association for editing .js files.

Ideally this should try to open it with notepad or some other built in editor?

@chabou I think we should revert your PR?

@ppot or make it smarter somehow?

If we change to .conf it won't execute it. It should be .conf @albinekb

I get a similar issue when i open the preferences.

hyper-error

Duplicate of #1810

Same issue with:

  • Hyper v1.3.3
  • Win 7 Enterprise 64bit

Let's add an option to .hyper.js to set preferred editor, and default it to notepad.exe on windows? 馃槃 (not needed on mac/linux since it handles .js files out of the box)

Same issue on:

  • Windows 10 Home
  • Hyper 1.3.3

Imo there are two solutions to this:

a) The proper way:
Include a config view similar to VSCode where it's basically a webview of the config file that lets you edit it.
This is probably tons of work but could pay off in the end since you can have the possible config values of settings as a tooltip hint and people have to go to the webpage less.
code_2017-05-23_17-39-27

b) The hack:

Fall back to notepad/whatever macOS has when the default for .js files is a known bad setting. Is it even possible to detect the default file handler via JS/Electron?

@Stanzilla I want to do an atom-like preferences setting once I did a rebuild. But It need to be step by step.

Workaround:

  1. find a random .js file on your computer.
  2. right click it, choose "Open with" > "Choose another app".
  3. choose an editor from the list that works for you (VSCode etc) and check "Always use this app to open .js files".

This will re-associate .js files with an editor instead of trying to execute it. Settings should open in this editor the next time you try it (CTRL+,).

I fixed this issue by selecting by default what code editor use to open js files, I just selected visual studio code and it is done! (Windows 10)

Just experienced this problem randomly on Mac after opening it fine in Visual Studio Code thousands of times. @kallaspriit 's solution is a good one, but it didn't work for me.

  1. Find a file with a .js extension.
  2. Right-click.
  3. Get Info.
  4. Open with.. (select program)
  5. Change all (will change all like-program extensions to open with this program).

Opens the preferences just fine.

Setting a default editor for .js files worked for me.

Instructions for Windows 10.

  1. Search for "Choose default apps by file type"
  2. Scroll down and find .js file type.
  3. Set default your text editor.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

weabot picture weabot  路  3Comments

ghost picture ghost  路  3Comments

eoinmurray picture eoinmurray  路  3Comments

rauchg picture rauchg  路  3Comments

ConstantinChirila picture ConstantinChirila  路  3Comments