Skip to content

Commit a6773ee

Browse files
authored
handle chunk register in the sync runtime.none correctly (vercel#4648)
### Description Using an async function in the sync runtime.none will swallow the error into a rejected Promise instead of rethrowing it.
1 parent 1d68fcb commit a6773ee

File tree

31 files changed

+62
-62
lines changed

31 files changed

+62
-62
lines changed

crates/turbopack-dev/js/src/runtime.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,15 +1388,15 @@ function markChunkListAsRuntime(chunkListPath) {
13881388
/**
13891389
* @param {ChunkRegistration} chunkRegistration
13901390
*/
1391-
async function registerChunk([chunkPath, chunkModules, runtimeParams]) {
1391+
function registerChunk([chunkPath, chunkModules, runtimeParams]) {
13921392
for (const [moduleId, moduleFactory] of Object.entries(chunkModules)) {
13931393
if (!moduleFactories[moduleId]) {
13941394
moduleFactories[moduleId] = moduleFactory;
13951395
}
13961396
addModuleToChunk(moduleId, chunkPath);
13971397
}
13981398

1399-
BACKEND.registerChunk(chunkPath, runtimeParams);
1399+
return BACKEND.registerChunk(chunkPath, runtimeParams);
14001400
}
14011401

14021402
globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS =

crates/turbopack-tests/tests/snapshot/basic/async_chunk/output/crates_turbopack-tests_tests_snapshot_basic_async_chunk_input_index_0d348e.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/turbopack-tests/tests/snapshot/basic/chunked/output/crates_turbopack-tests_tests_snapshot_basic_chunked_input_index_e77e9f.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/turbopack-tests/tests/snapshot/basic/shebang/output/crates_turbopack-tests_tests_snapshot_basic_shebang_input_index_b1f0c2.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/turbopack-tests/tests/snapshot/comptime/define/output/crates_turbopack-tests_tests_snapshot_comptime_define_input_index_6b0d2b.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/turbopack-tests/tests/snapshot/css/absolute-uri-import/output/crates_turbopack-tests_tests_snapshot_css_absolute-uri-import_input_index_fa9a30.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/turbopack-tests/tests/snapshot/css/css/output/crates_turbopack-tests_tests_snapshot_css_css_input_index_37a138.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/turbopack-tests/tests/snapshot/emotion/emotion/output/crates_turbopack-tests_tests_snapshot_emotion_emotion_input_index_b080c4.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/turbopack-tests/tests/snapshot/env/env/output/crates_turbopack-tests_tests_snapshot_env_env_input_index_29a23f.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/turbopack-tests/tests/snapshot/evaluated_entrry/runtime_entry/output/a587c_tests_snapshot_evaluated_entrry_runtime_entry_input_index_f59cc7.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)