electron: Dev tools JSX files: Uncaught (in promise) Error: Could not instantiate: CmModes.DefaultCodeMirrorMimeMode

  • Output of node_modules/.bin/electron --version: 2.0.8
  • Operating System (Platform and Version): MacOS 10.13.6
  • Output of node_modules/.bin/electron --version on last known working Electron version (if applicable):

Expected Behavior JSX files should have syntax highlighting like with JS files.

Actual behavior JSX files in the sources tab show as plain white text, the error is shown in the terminal: Uncaught (in promise) Error: Could not instantiate: CmModes.DefaultCodeMirrorMimeMode

To Reproduce Simply open a JSX file in your sources.

Additional Information On a normal Chrome browser, JSX files have syntax highlighting working.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 22
  • Comments: 16 (1 by maintainers)

Most upvoted comments

Here’s a repo, at least for me, maybe I’m doing something stupid

git clone https://github.com/greggman/electron-issue-14418-repo.git
cd electron-issue-14418-repo
npm install
npm run build
npm run start

You should see a devtools

Clicking on view.jsx

screen shot 2018-09-30 at 20 38 32

Generates the following errors in the terminal

[34763:0930/203815.963745:ERROR:CONSOLE(22)] "Empty response arrived for script 'chrome-devtools://devtools/remote/serve_file/@164c37e3f235134c88e80fac2a182cfba3f07f00/cm_modes/cm_modes_module.js'", source: chrome-devtools://devtools/bundled/shell.js (22)
[34763:0930/203815.965639:ERROR:CONSOLE(106)] "Uncaught (in promise) Error: Could not instantiate: CmModes.DefaultCodeMirrorMimeMode", source: chrome-devtools://devtools/bundled/shell.js (106)
[34763:0930/203815.965680:ERROR:CONSOLE(106)] "Uncaught (in promise) Error: Could not instantiate: CmModes.DefaultCodeMirrorMimeMode", source: chrome-devtools://devtools/bundled/shell.js (106)

Still getting this in Windows with Electron v7.0.1, more information may also come in the possibly duplicate issue:

https://github.com/electron/electron/issues/13008

I’m seeing the same errors for both typescript *.ts and typescript-react *.tsx files. Both show as plain/white text in the dev console, throwing the same “Could not instantiate: CmModes.DefaultCodeMirrorMimeMode” errors.

Operating System: Linux, Debian testing (Buster).

$> ./node_modules/.bin/electron --version
v4.0.8
$> node --version
v10.15.3
[11296:0311/125758.384216:ERROR:CONSOLE(24)] "Empty response arrived for script 'chrome-devtools://devtools/remote/serve_file/@d40e05708f87d6a979ad88cc493af0da62efbfe4/cm_modes/cm_modes_module.js'", source: chrome-devtools://devtools/bundled/shell.js (24)
[11296:0311/125758.386180:ERROR:CONSOLE(108)] "Uncaught (in promise) Error: Could not instantiate: CmModes.DefaultCodeMirrorMimeMode", source: chrome-devtools://devtools/bundled/shell.js (108)
[11296:0311/125758.410651:ERROR:CONSOLE(108)] "Uncaught (in promise) Error: Could not instantiate: CmModes.DefaultCodeMirrorMimeMode", source: chrome-devtools://devtools/bundled/shell.js (108)
[11296:0311/125811.580001:ERROR:CONSOLE(108)] "Uncaught (in promise) Error: Could not instantiate: CmModes.DefaultCodeMirrorMimeMode", source: chrome-devtools://devtools/bundled/shell.js (108)

Like the original poster, these files have proper syntax highlighting on a normal Chrome browser.

The Electron version reported on this issue is no longer supported. See our supported versions documentation.

If this is still reproducible on a supported version, please open a new issue with any other new information that a maintainer should know.

Thank you for taking the time to report this issue and helping to make Electron better! Your help is appreciated.

the same error goes with mac/electron@6.1.5

This issue is also in newly-released 6.0.0

I have the same problem using TypeScript both ts and tsx files.

Hope it’s solved soon, I can try to solve it with some direction.