I don't understand why I get this kind of error.no matter which method you try
GET http://localhost:3000/backend
An unhandled error occured: TypeError: Failed to parse URL from /api/data
at Object.fetch (node:internal/deps/undici/undici:11576:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async fetchData (eval at instantiateModule (file:///D:/%E0%B8%87%E0%B8%B2%E0%B8%99/Discord/Discord%20Bot/discord-server-web/Frontend/node_modules/vite/dist/node/chunks/dep-df561101.js:55971:28), <anonymous>:15:22)
14 Replies
server.js
vite.config.js
backend.jsx
![No description](https://cdn.answeroverflow.com/1141073668210950264/image.png)
Does this work using the full url? e.g
http://localhost:3001/api/data
BTW make use of a createResource instead or an onMountAnd your issue seems to be with the vite config. Here's a link to the vite docs concerning sever options https://vitejs.dev/config/server-options.html
Vite
Next Generation Frontend Tooling
TLDR: use
http://localhost:3000/api/data
and it should workno data onweb
but console.log(data.message) have data
Try making use of a createResource, return the data from the fetchData function and make use of the data signal returned from createResource
I've been trying to find information on google for a few days about createResource I don't understand.
Do I need to create a file or where do I start?
![No description](https://cdn.answeroverflow.com/1142324488361488414/image.png)
Mind showing me a photo of your logic? You seem to be making use of createEffect and fetchData wrong
Try this
Quick question, why are you requesting the title and description of the page from a server?
after createResource, i can use it to all page ?
thank you
![No description](https://cdn.answeroverflow.com/1142822872922992734/image.png)
https://www.littlekittlylove.xyz/
but i have problem with navbar
When using it in the computer, everything seems normal.
Until I took it to the VPS and the button didn't work.
💮ชมรมคนเหงา💘
หืมม ~ ชมรมคนเหงา ยินดีต้à¸à¸™à¸£à¸±à¸šà¸—ุà¸à¸„นน๊าาา หาà¸à¸ªà¸™à¹ƒà¸ˆà¸à¸¢à¹ˆà¸²à¸¥à¸·à¸¡à¹€à¸‚้ามาเม้าท์มà¸à¸¢à¸à¸±à¸™à¸™à¸°