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

Cannot use keyword 'await' outside an async function #1

Closed
mylastore opened this issue Jul 28, 2019 · 1 comment
Closed

Cannot use keyword 'await' outside an async function #1

mylastore opened this issue Jul 28, 2019 · 1 comment

Comments

@mylastore
Copy link

I have this on sapper preload section and get this that error

<script context="module">
    import {create} from '@beyonk/sapper-httpclient';

    export function preload(page) {
        const api = create();
        return {json} = await api
                .transport(fetch) // pass node fetch in here.
                .endpoint('/meetups')
                .get();
        console.log(json);
    }
</script>
@mylastore
Copy link
Author

sore I figure this one out by addy async to the export function

@antony antony closed this as completed Jul 29, 2019
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

2 participants