sebastian-software / edge

The Lerna Repository for Edge Platform
Apache License 2.0
33 stars 7 forks source link

Latest version breaks when using apollo #2

Closed feibeck closed 7 years ago

feibeck commented 7 years ago

After updating a project to the latest edge version with the new builder GraphQL with Apollo stopped working because of some Webpack bundling error. I'm getting the following error shown in the browser: Error: __WEBPACK_IMPORTED_MODULE_3_react_apollo__.gql is not a function. Rendering on server shows chunk not available for synchronous require yet: ./src/views/Foo.js: _reactApollo.gql is not a function. It seems like react_apollo is missing in the application build.

To reproduce this you could add the following lines to any component (e.g. Counter) of the boilerplate app and run it.

import { gql, graphql } from "react-apollo"

const TestWithData = graphql(gql``)(Test)
function Test({ data: { loading, error, data } }) {
  return <div>Test</div>
}

Unfortunately I'm not that good in debugging and fixing such issues related to Webpack. Could you please take a look and check if this is some error introduced with the new builder? Thank you!

feibeck commented 7 years ago

It's the switch to Apollo 2, after fixing the imports the app is running!