8000 fix(replay): Ensure lodash.debounce does not trigger next.js warning … · danieliu/sentry-javascript@d9963fc · GitHub
[go: up one dir, main page]

Skip to content

Commit d9963fc

Browse files
authored
fix(replay): Ensure lodash.debounce does not trigger next.js warning (getsentry#6551)
lodash.debounce uses `Function('')`, which nextjs interprets as unsafe, and does not work there. See: lodash/lodash#5394 We don't really need that fallback anyhow, `global || self` should be fine for us.
1 parent 2c09d9a commit d9963fc

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

patches/lodash.debounce+4.0.8.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/node_modules/lodash.debounce/index.js b/node_modules/lodash.debounce/index.js
2+
index ac5707d..7447acd 100644
3+
--- a/node_modules/lodash.debounce/index.js
4+
+++ b/node_modules/lodash.debounce/index.js
5+
@@ -38,7 +38,7 @@ var freeGlobal = typeof global == 'object' && global && global.Object === Object
6+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
7+
8+
/** Used as a reference to the global object. */
9+
-var root = freeGlobal || freeSelf || Function('return this')();
10+
+var root = freeGlobal || freeSelf;
11+
12+
/** Used for built-in method references. */
13+
var objectProto = Object.prototype;

0 commit comments

Comments
 (0)
0