Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting Error: when doing async communication #118

Open
soniAnkur opened this issue Apr 24, 2023 · 0 comments
Open

Getting Error: when doing async communication #118

soniAnkur opened this issue Apr 24, 2023 · 0 comments

Comments

@soniAnkur
Copy link

Hi,
I am getting following error when raising 'test' event.

image

On sender


const parent = window.opener;

postRobot.send(parent, 'test', someRandomJSON, { timeout: 5000 }).then((event) => {
        output.innerText = `Got async response from parent:, ${JSON.stringify(event.data, null, 4)}`
      }).catch(error => {
        console.log(error);
      });

on receiver

postRobot.on('test', (event) => {
                return fetch('https://jsonplaceholder.typicode.com/posts/1')
                    .then(response => response.json())
                    .then(json => {
                        return json;
                    })
            });

Could someone help me with whats causing the issue/how to fix

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant