-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
global in not defined #259
Comments
I use this package with Electron, and I was able to workaround it with the following: #66 (comment) |
haha, I used the same workaround 😄. but better to fix it in the package: #260 |
fix: global is not defined (fixes #259)
in esbuild either use: define: {
'global': 'window'
} or a patch see: #259 (comment) |
@marcelgerber no they wont ^^ im now using a patch like: fixes https://github.com/scniro/react-codemirror2/pull/260#issuecomment-1023202972
this bug has been fixed and merged to the source code of react-codemirror2,
but the maintainers said that they won't release it, because they are not using the project anymore.
diff --git a/index.js b/index.js
index d109de477e2b4afa44836ac8da63e75542743919..823a6b014ad15b895dcaf69f88b81f6c575320bd 100644
--- a/index.js
+++ b/index.js
@@ -63,7 +63,7 @@ exports.UnControlled = exports.Controlled = void 0;
var React = require('react');
-var SERVER_RENDERED = typeof navigator === 'undefined' || global['PREVENT_CODEMIRROR_RENDER'] === true;
+var SERVER_RENDERED = false;
var cm;
if (!SERVER_RENDERED) { |
@mhsdesign yes, I'm using a similar patch now (through yarn 3). it's nice that this is easily possible, but on the other hand it would be even nicer if I didn't have to do that, and could just run the code that's in this repo already, but just doesn't get pushed to npm. Thank you nonetheless :) |
react-codemirror2/index.js
Line 66 in 3d49010
this line will cause error in browsers(no webpack bundled). would it be possible to change to:
The text was updated successfully, but these errors were encountered: