edges-svelte 0.6.0 ā 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,7 +18,15 @@ export const edgesHandle = async (event, callback, silentChromeDevtools = false)
|
|
18
18
|
RequestContext.current = () => {
|
19
19
|
const context = storage.getStore();
|
20
20
|
if (context === undefined) {
|
21
|
-
throw new Error('
|
21
|
+
throw new Error('[Edge-S] State access attempted outside of a valid request context.\n' +
|
22
|
+
'\nThis usually happens if you are calling a provider or using `createState`/`createDerivedState` at the module (top) level.\n' +
|
23
|
+
'\nā
Correct usage:\n' +
|
24
|
+
' - Inside a `load` function (page.server.ts / page.ts)\n' +
|
25
|
+
' - Inside Svelte components (in <script>)\n' +
|
26
|
+
' - Inside `handle` hook or other request-scoped logic\n' +
|
27
|
+
'\nš« Incorrect usage:\n' +
|
28
|
+
' - Calling providers or states directly at the top level of a module (e.g., outside any function or component)\n' +
|
29
|
+
'\nTo fix this, wrap your provider or state call inside a function, component, or request handler.\n');
|
22
30
|
}
|
23
31
|
return context;
|
24
32
|
};
|