Skip to content

BUG/Async & Await syntax not usable with current webpack config #73

@jctbog9

Description

@jctbog9

Async await syntax returns a regenerator runtime is not defined error.

Stack Trace:

queries.js:3 Uncaught ReferenceError: regeneratorRuntime is not defined
    at queries.js:3
    at Object.<anonymous> (queries.js:3)
    at Object.<anonymous> (queries.js:34)
    at __webpack_require__ (bootstrap 535a2b23cfd29fa1ad3e:19)
    at Object.<anonymous> (checkPropTypes.js:102)
    at __webpack_require__ (bootstrap 535a2b23cfd29fa1ad3e:19)
    at Object.<anonymous> (App.js:1)
    at __webpack_require__ (bootstrap 535a2b23cfd29fa1ad3e:19)
    at Object.<anonymous> (application.js:2)
    at __webpack_require__ (bootstrap 535a2b23cfd29fa1ad3e:19)

Code:

const API_HOST = process.env.API_HOST

export const getProjects = async (userId) => {
  const options = {
    headers: {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    },
    query: `query { <contents> }`
  }

  const response = await fetch(API_HOST, options)
  return response
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions