Skip to content

Commit bcba0c6

Browse files
authored
Attempt to fix videoUploadingWebCodecs redirect again (#368)
define BASE_PATH so we don't try to evaluate it at runtime. It is only defined in the environment at build time.
1 parent 95137ca commit bcba0c6

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Diff for: next.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ module.exports = {
2727
const source = fs.readFileSync(v.module.userRequest, 'utf-8');
2828
return JSON.stringify(source); // Strings need to be wrapped in quotes
2929
}, []),
30+
BASE_PATH: JSON.stringify(process.env.BASE_PATH || ''),
3031
})
3132
);
3233

Diff for: src/pages/samples/videoUploadingWebCodecs.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ function Page(): JSX.Element {
55
<Head>
66
<meta
77
httpEquiv="refresh"
8-
content={`0; url=${
9-
process.env.BASE_PATH || ''
10-
}/samples/videoUploading?videoSource=videoFrame`}
8+
content={`0; url=${BASE_PATH}/samples/videoUploading?videoSource=videoFrame`}
119
></meta>
1210
</Head>
1311
);

Diff for: src/types.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ interface HTMLCanvasElement extends HTMLElement {
99
}
1010

1111
declare const __SOURCE__: string;
12+
declare const BASE_PATH: string;
1213

1314
// Defined by webpack.
1415
declare namespace NodeJS {

0 commit comments

Comments
 (0)