Skip to content

🎥 Make videos programmatically with React

`@remotion/studio`: Fix sourcemap not being loaded on Lambda site

Jonny Burger81fc27b3831d
diff --git a/packages/studio/src/components/Timeline/TimelineStack/index.tsx b/packages/studio/src/components/Timeline/TimelineStack/index.tsx
index e94ea2f0ec..2b63a5e42a 100644
--- a/packages/studio/src/components/Timeline/TimelineStack/index.tsx
+++ b/packages/studio/src/components/Timeline/TimelineStack/index.tsx
@@ -26,11 +26,16 @@ import {Spacing} from '../../layout';
import {getOriginalLocationFromStack} from './get-stack';
import {getOriginalSourceAttribution} from './source-attribution';
+const publicPath =
+ window.remotion_publicPath === '/' ? '' : window.remotion_publicPath;
+
+const withoutSlashInTheEnd = publicPath.endsWith('/')
+ ? publicPath.slice(0, -1)
+ : publicPath;
+
// @ts-expect-error
SourceMapConsumer.initialize({
- 'lib/mappings.wasm':
- (window.remotion_publicPath === '/' ? '' : window.remotion_publicPath) +
- SOURCE_MAP_ENDPOINT,
+ 'lib/mappings.wasm': withoutSlashInTheEnd + SOURCE_MAP_ENDPOINT,
});
export const TimelineStack: React.FC<{