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
TypeError: Cannot read property 'name' of undefined
at navBar.svelte:28:19
at Object.$$render (C:\Users\belji\Desktop\my-app17\node_modules\svelte\internal\index.js:1745:22)
at eval (/src/routes/__layout.svelte:27:134)
at Object.$$render (C:\Users\belji\Desktop\my-app17\node_modules\svelte\internal\index.js:1745:22)
at root.svelte:37:45
at $$render (C:\Users\belji\Desktop\my-app17\node_modules\svelte\internal\index.js:1745:22)
at Object.render (C:\Users\belji\Desktop\my-app17\node_modules\svelte\internal\index.js:1753:26)
at render_response (file:///C:/Users/belji/Desktop/my-app17/node_modules/@sveltejs/kit/dist/chunks/index.js:1069:28)
at async respond_with_error (file:///C:/Users/belji/Desktop/my-app17/node_modules/@sveltejs/kit/dist/chunks/index.js:1690:10)
at async respond$1 (file:///C:/Users/belji/Desktop/my-app17/node_modules/@sveltejs/kit/dist/chunks/index.js:1941:4)
<script context="module">
/** @type {import('@sveltejs/kit').Load} */
export async function load({fetch }) {
const res = await fetch(`navBar.json`);
if (res.ok) {
return {
props: {
topic: await res.json(),
}
};
}
return {
status: res.status,
error: new Error(`navBar.json`)
};
}
</script>
<script>
export let topic;
</script>
{topic.name}
import * as fs from 'fs';
import matter from 'gray-matter'
$ curl http://localhost:3000/navBar.json
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 827 0 827 0 0 33926 0 --:--:-- --:--:-- --:--:-- 35956{"topic":[{"name":"Kontakt","pathname":"/Kontakt/kontakt","menu":"Kontakt","version":"20.07.r01"},{"name":"Menü","route":"Menü/Dessert","menu":"Menu","version":"21.03R01"},{"name":"Menü","route":"Menü/Gerichte","menu":"Menu","version":"21.03R01"},{"name":"Menü","route":"Menü/Getränke","menu":"Menu","version":"21.03R01"},{"name":"Menü","route":"Menü/GrillTeller","menu":"Menu","version":"21.03R01"},{"name":"Menü","route":"Menü/vegan","menu":"Menu","version":"21.03R01"},{"name":"Menü","route":"Menü/Vegetarisch","menu":"Menu","version":"21.03R01"},{"name":"Restaurant","pathname":"/Lage/lage","menu":"Restaurant","version":"21.03R01"},{"name":"Service","route":"/Service/Service","menu":"Service","version":"20.10.R01"},{"name":"Über uns","route":"/Über uns/UeberUns","menu":"Über uns","version":"21.03R01"}]}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
TypeError: Cannot read property 'name' of undefined
<script context="module"> /** @type {import('@sveltejs/kit').Load} */ export async function load({fetch }) { const res = await fetch(`navBar.json`); if (res.ok) { return { props: { topic: await res.json(), } }; } return { status: res.status, error: new Error(`navBar.json`) }; } </script> <script> export let topic; </script>at navBar.svelte:28:19
at Object.$$render (C:\Users\belji\Desktop\my-app17\node_modules\svelte\internal\index.js:1745:22)
at eval (/src/routes/__layout.svelte:27:134)
at Object.$$render (C:\Users\belji\Desktop\my-app17\node_modules\svelte\internal\index.js:1745:22)
at root.svelte:37:45
at $$render (C:\Users\belji\Desktop\my-app17\node_modules\svelte\internal\index.js:1745:22)
at Object.render (C:\Users\belji\Desktop\my-app17\node_modules\svelte\internal\index.js:1753:26)
at render_response (file:///C:/Users/belji/Desktop/my-app17/node_modules/@sveltejs/kit/dist/chunks/index.js:1069:28)
at async respond_with_error (file:///C:/Users/belji/Desktop/my-app17/node_modules/@sveltejs/kit/dist/chunks/index.js:1690:10)
at async respond$1 (file:///C:/Users/belji/Desktop/my-app17/node_modules/@sveltejs/kit/dist/chunks/index.js:1941:4)
import * as fs from 'fs';
import matter from 'gray-matter'
/** @type {import('@sveltejs/kit').RequestHandler} */
export async function get({ params }) {
const {fileName} = params;
}
$ curl http://localhost:3000/navBar.json
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 827 0 827 0 0 33926 0 --:--:-- --:--:-- --:--:-- 35956{"topic":[{"name":"Kontakt","pathname":"/Kontakt/kontakt","menu":"Kontakt","version":"20.07.r01"},{"name":"Menü","route":"Menü/Dessert","menu":"Menu","version":"21.03R01"},{"name":"Menü","route":"Menü/Gerichte","menu":"Menu","version":"21.03R01"},{"name":"Menü","route":"Menü/Getränke","menu":"Menu","version":"21.03R01"},{"name":"Menü","route":"Menü/GrillTeller","menu":"Menu","version":"21.03R01"},{"name":"Menü","route":"Menü/vegan","menu":"Menu","version":"21.03R01"},{"name":"Menü","route":"Menü/Vegetarisch","menu":"Menu","version":"21.03R01"},{"name":"Restaurant","pathname":"/Lage/lage","menu":"Restaurant","version":"21.03R01"},{"name":"Service","route":"/Service/Service","menu":"Service","version":"20.10.R01"},{"name":"Über uns","route":"/Über uns/UeberUns","menu":"Über uns","version":"21.03R01"}]}
Beta Was this translation helpful? Give feedback.
All reactions