Codemirror: ReferenceError: navigator is not defined

Created on 23 Jun 2018  路  3Comments  路  Source: codemirror/CodeMirror

im using node version of this code so when is start electron app the this error occurs!!!! anyone knows the solution for this..

the error is

ReferenceError: navigator is not defined
at F:\mEdit\node_modules\codemirror\lib\codemirror.js:18:17
at userAgent (F:\mEdit\node_modules\codemirror\lib\codemirror.js:11:82)
at Object. (F:\mEdit\node_modules\codemirror\lib\codemirror.js:14:2)
at Object. (F:\mEdit\node_modules\codemirror\lib\codemirror.js:9697:3)
at Module._compile (module.js:642:30)
at Object.Module._extensions..js (module.js:653:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:504:12)
at Function.Module._load (module.js:496:3)
at Module.require (module.js:586:17)

thanks in advance

All 3 comments

navigator exists in browser environment. Are you trying to run codemirror in Node environment?
Could you please provide a reproduction repository with your code?

using node version of this code

There is no node version of this code, and at the moment CodeMirror can only be loaded in a browser environment (because it doesn't do anything useful outside of that).

I also had similar issue when I ran HTML script in Microsoft Edge Browser but when I ran my HTML script in Firefox and Chrome browser then it was working fine. Try to run your HTML script in different browser.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ellisonbg picture ellisonbg  路  4Comments

reachnithya18 picture reachnithya18  路  3Comments

Pomax picture Pomax  路  3Comments

alangdm picture alangdm  路  3Comments

blgm picture blgm  路  4Comments