Jump to content

Client-Side Fetch Error and TypeScript Integration Issue in Vue/Nuxt


PTiCA1

Recommended Posts

1. I need to create an issue report regarding an error encountered while using the fetch() function to retrieve data from a REST API.

When loading data from the server using SSR (Server-Side Rendering), everything loads correctly. However, when attempting to reload on the client-side, the browser console throws the following error:

[Error] Fetch API cannot load https://forum.???.cz/api/forums/posts?sortBy=date&sortDir=desc&perPage=6 due to access control checks.
[Error] Failed to load resource: Preflight response is not successful. Status code: 401 (posts, line 0)

and

Access to fetch at 'https://forum.???.cz/api/forums/posts?sortBy=date&sortDir=desc&perPage=6' from origin 'https://???.vercel.app' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

 

2. The inability to download a TypeScript "interface" in a JavaScript application, such as Vue/Nuxt, through any method like codegen.

3. Additionally, I would like to mention that the documentation is quite inadequate and needs significant improvement.

Link to comment
Share on other sites

1 hour ago, PTiCA1 said:

1. I need to create an issue report regarding an error encountered while using the fetch() function to retrieve data from a REST API.

When loading data from the server using SSR (Server-Side Rendering), everything loads correctly. However, when attempting to reload on the client-side, the browser console throws the following error:

This is typically caused by the CORS setting on your server. 

1 hour ago, PTiCA1 said:

2. The inability to download a TypeScript "interface" in a JavaScript application, such as Vue/Nuxt, through any method like codegen.

I'm not quite sure what you're referring to here or expecting as we do not support TypeScript.

1 hour ago, PTiCA1 said:

3. Additionally, I would like to mention that the documentation is quite inadequate and needs significant improvement.

We encourage you to post anywhere in our Feedback forum that you feel is lacking. We can of course get to that as time allows and it makes sense for us to do so.

Link to comment
Share on other sites

Curious what exactly you are trying to do with #2 and why you may feel this is an IPS sided issue?  I would imagine you are using the Fetch API to make HTTP calls to the IPS REST API to CRUD IPS relative data.  How and what you use to manage the presentation of that data and make calls to the REST API is in your control.  #2 is outside the scope of IPS entirely and based on #1 I would think you are only using IPS for it's backend impl and leveraging it's API to CRUD data within it from your frontend stack of choice.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Upcoming Events

    No upcoming events found
×
×
  • Create New...