Skip to content

Ch 7.02 Error in sending data to server: Cannot read property 'UI_API_ENDPOINT' of undefined #35

@luiespo111

Description

@luiespo111

I am getting this issue at chapter 7.02.
The problem looks to be in in App.jsx, at the graphQLFetch function:

async function graphQLFetch(query, variables = {}) {
try {
const response = await fetch(window.ENV.UI_API_ENDPOINT, {
method: 'POST',
headers: { 'Content-Type': 'application/json'},
body: JSON.stringify({ query, variables })
});

Where the window.ENV results undefined

The global variable should be set in env.js file and i can see its definition in the browser console.

This prevent the table to be displayed in the browser in its initial form.
If I try to add an issue is works and displays the full table.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions