You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When edge: true is set in the svelte.config.js file, the event.platform.context can only be seen on a deployed site. On sveltekit's port it is underfined and running ntl dev gets an empty object which does mean that it exists, however it is not a great dev experience for testing and creating edge functions. I would like to see the same thing locally as the deployed application shows. I'm unsure if this problem lies in the adapter or in ntl dev but figured I would start here.
Run pnpm run dev at localhost:3000, undefined is shown on the / route. No errors in console, but warning about expected prop ctx not being present.
Run ntl dev at localhost:8888, {} is shown on the / route. There are 4 errors in the console, all 404s about resources not being found. I posted these in the logs below.
Deploy site to Netlify and full ctx object is present on the / route. No errors in console.
Logs
Failed to load resource: the server responded with a status of 404 (Not Found)
start-b2afe8b6.js:1
index-dd64db13.js:1
__layout.svelte-0d57de41.js:1
index.svelte-9a34a6ed.js:1
Yeah, this is a special case of #3535 and #4292. I'm going to close this issue as it's basically covered by those. It's high priority though I haven't quite wrapped my head round how it'll work, since ntl dev and vc dev and wrangler etc don't provide obvious ways to hook into Vite's server (or vice versa)
Describe the bug
When
edge: true
is set in thesvelte.config.js
file, theevent.platform.context
can only be seen on a deployed site. On sveltekit's port it is underfined and runningntl dev
gets an empty object which does mean that it exists, however it is not a great dev experience for testing and creating edge functions. I would like to see the same thing locally as the deployed application shows. I'm unsure if this problem lies in the adapter or inntl dev
but figured I would start here.Reproduction
Repo: https://github.com/brittneypostma/sveltekit-on-the-edge
pnpm run dev
atlocalhost:3000
,undefined
is shown on the/
route. No errors in console, but warning about expected propctx
not being present.ntl dev
atlocalhost:8888
,{}
is shown on the/
route. There are 4 errors in the console, all 404s about resources not being found. I posted these in the logs below.ctx
object is present on the/
route. No errors in console.Logs
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: