@remotion/bundler 3.2.28 → 3.2.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/renderEntry.js +26 -3
- package/package.json +3 -3
package/dist/renderEntry.js
CHANGED
|
@@ -15,6 +15,19 @@ const remotion_1 = require("remotion");
|
|
|
15
15
|
const bundle_mode_1 = require("./bundle-mode");
|
|
16
16
|
const homepage_1 = require("./homepage/homepage");
|
|
17
17
|
remotion_1.Internals.CSSUtils.injectCSS(remotion_1.Internals.CSSUtils.makeDefaultCSS(null, '#fff'));
|
|
18
|
+
const getCanSerializeDefaultProps = (object) => {
|
|
19
|
+
try {
|
|
20
|
+
const str = JSON.stringify(object);
|
|
21
|
+
// 256MB is the theoretical limit, making it throw if over 90% of that is reached.
|
|
22
|
+
return str.length < 256 * 1024 * 1024 * 0.9;
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
if (err.message.includes('Invalid string length')) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
throw err;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
18
31
|
const GetVideo = ({ state }) => {
|
|
19
32
|
const video = remotion_1.Internals.useVideo();
|
|
20
33
|
const compositions = (0, react_1.useContext)(remotion_1.Internals.CompositionManager);
|
|
@@ -161,9 +174,19 @@ if (typeof window !== 'undefined') {
|
|
|
161
174
|
if (!remotion_1.Internals.compositionsRef.current) {
|
|
162
175
|
throw new Error('Unexpectedly did not have a CompositionManager');
|
|
163
176
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
177
|
+
const compositions = remotion_1.Internals.compositionsRef.current.getCompositions();
|
|
178
|
+
const canSerializeDefaultProps = getCanSerializeDefaultProps(compositions);
|
|
179
|
+
if (!canSerializeDefaultProps) {
|
|
180
|
+
console.warn('defaultProps are too big to serialize - trying to find the problematic composition...');
|
|
181
|
+
for (const comp of compositions) {
|
|
182
|
+
if (!getCanSerializeDefaultProps(comp)) {
|
|
183
|
+
throw new Error(`defaultProps too big - could not serialize - the defaultProps of composition with ID ${comp.id} - the object that was passed to defaultProps was too big. Learn how to mitigate this error by visiting https://remotion.dev/docs/troubleshooting/serialize-defaultprops`);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
console.warn('Could not single out a problematic composition - The composition list as a whole is too big to serialize.');
|
|
187
|
+
throw new Error('defaultProps too big - Could not serialize - an object that was passed to defaultProps was too big. Learn how to mitigate this error by visiting https://remotion.dev/docs/troubleshooting/serialize-defaultprops');
|
|
188
|
+
}
|
|
189
|
+
return compositions.map((c) => {
|
|
167
190
|
return {
|
|
168
191
|
defaultProps: c.defaultProps,
|
|
169
192
|
durationInFrames: c.durationInFrames,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remotion/bundler",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.29",
|
|
4
4
|
"description": "Bundler for Remotion",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"css-loader": "5.2.7",
|
|
27
27
|
"esbuild": "0.14.19",
|
|
28
28
|
"react-refresh": "0.9.0",
|
|
29
|
-
"remotion": "3.2.
|
|
29
|
+
"remotion": "3.2.29",
|
|
30
30
|
"style-loader": "2.0.0",
|
|
31
31
|
"webpack": "5.74.0"
|
|
32
32
|
},
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "9a2ff4d68324af8d1fe55ebdf94bdadccf446a10"
|
|
68
68
|
}
|