codemirror / dev

Development repository for the CodeMirror editor project
https://codemirror.net/
Other
5.94k stars 377 forks source link

Getting "document is not defined" error on while our app loads CodeMirrorEditor #1400

Closed Deepali1211 closed 4 months ago

Deepali1211 commented 4 months ago

Describe the issue

Problem:

Our app is crashing while loading the Code Mirror Editor since version 4.22.2 with the error document is not defined It was working fine till version 4.22.1

Here is the stacktrace:

Error rendering react template: Failed to render app on server with exception document is not defined ReferenceError: document is not defined
    at /app/node_modules/codemirror/lib/codemirror.js:88:3
    at /app/node_modules/codemirror/lib/codemirror.js:11:83
    at Object.<anonymous> (/app/node_modules/codemirror/lib/codemirror.js:14:2)
    at Module._compile (node:internal/modules/cjs/loader:1467:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1551:10)
    at Module.load (node:internal/modules/cjs/loader:1282:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1098:12)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:215:24)
    at Module.require (node:internal/modules/cjs/loader:1304:12)
    at require (node:internal/modules/helpers:123:16)
    at Object.<anonymous> (/app/node_modules/react-codemirror17/index.js:70:8)
    at Module._compile (node:internal/modules/cjs/loader:1467:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1551:10)
    at Module.load (node:internal/modules/cjs/loader:1282:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1098:12)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:215:24)
    at Module.require (node:internal/modules/cjs/loader:1304:12)
    at require (node:internal/modules/helpers:123:16)
    at Object.<anonymous> (/app/node_modules/@console/pal/Components/lib/CodeSidePanel/CodeSidePanel.js:8:24)
    at Module._compile (node:internal/modules/cjs/loader:1467:14)

Browser and platform

No response

Reproduction link

No response

marijnh commented 4 months ago

I have never released a version 4.22.2 of CodeMirror.

Deepali1211 commented 4 months ago

Error seems to be coming from /app/node_modules/codemirror/lib/codemirror.js:88:3 file

marijnh commented 4 months ago

I'm going to close this, since it seems you're talking about some pre-6 version of CodeMirror, referring to a nonexistent version number, and describing an issue that is more likely than not a problem in your own code.

Deepali1211 commented 4 months ago

Sorry for confusion, We are using these versions:

    "@codemirror/autocomplete": "6.17.0",
    "@codemirror/language": "6.10.2",
    "@codemirror/lint": "6.8.1",
    "@codemirror/state": "6.4.1",
    "@codemirror/view": "6.28.4",
marijnh commented 4 months ago

There is no node_modules/codemirror/lib/codemirror.js file in version 6+ of the library.