35f68bc691
Right now, when doing the following in an Edge API: ```typescript export default async () => { await fetch("https://hello.world"); }; ``` The stack trace generated does not contain the actual line of code that caused the error. This gives a bad developer experience when working with `next dev`. This PR fixes that for this specific use case and adds a test to make sure there's no regression. For `next start`, there's also a small change, that needs to be pushed upstream to `edge-runtime`. In order to run user code in the Edge Runtime, we call `vm.evaluate(code: string)`. However, if we embrace the `options` from the signature of `vm.runInContext(code, ctx, options)`, we can pass in the filename so the stack trace is correct. ## Bug - [ ] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have a helpful link attached, see [`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md) |
||
---|---|---|
.. | ||
api | ||
index.js |