fix(next-core): align edge chunking context's asset root (#57022)
### What?
If there's a static asset with edge runtime config, turbopack will bail with
```
⨯ ModuleBuildError: Code generation for chunk item errored
An error occurred while generating the chunk item [project]/test/e2e/app-dir/metadata/app/icon.svg (static, edge rsc)
Caused by:
- expected output_root to contain asset path
Debug info:
- An error occurred while generating the chunk item [project]/test/e2e/app-dir/metadata/app/icon.svg (static, edge rsc)
- Execution of <DevChunkingContext as ChunkingContext>::asset_url failed
- expected output_root to contain asset path
```
Since we creates chunking context for the edge with different output_root and asset_root, by using asset_root to be client_root. The other places creating context with `DevChunkingContext` don't do this, PR simply adjusting root to be output_root.
For the server's chunking context it actually accepts client_root and set the asseturl with client root instead. However not sure if that's what we want with devchunkingcontext.
This is part of metadata fixes for the test; however edge rendering still doesn't work so test doesn't pass yet.
Closes WEB-1798
Showing
Please
register
or
sign in
to comment