leebenson / reactql

Universal React+GraphQL starter kit: React 16, Apollo 2, MobX, Emotion, Webpack 4, GraphQL Code Generator, React Router 4, PostCSS, SSR
https://reactql.org
MIT License
1.82k stars 173 forks source link

Failed to compile #122

Closed jimjamdev closed 5 years ago

jimjamdev commented 5 years ago

I'm giving this a try on ubuntu and windows 10 pro, and it won't compile.

webpack: Encountered errors while compiling. Reload prevented.
_ @ log.js:59
errors @ client:60
(anonymous) @ socket.js:49
log.js:59 「hot」 (client) ./node_modules/graphql/index.mjs 64:0-70:117Can't reexport the named export 'BREAK' from non EcmaScript module (only default export is available)    at HarmonyExportImportedSpecifierDependency._getErrors 

There's a heap of these errors from different scripts, and I'm running the latest node LTS.

leebenson commented 5 years ago

Are you using plain .js imports in your project?

On first glance, this seems like it might be the fix.

Per https://github.com/leebenson/reactql/issues/119, I need to check for support for plain .js. I'm personally using .ts|tsx throughout projects, so this needs properly testing.

jimjamdev commented 5 years ago

This is just running the example. I've not added anything :)

leebenson commented 5 years ago

Found the fix.

.mjs was missing from the Webpack resolve.extensions option, which meant that ES6 module support was being deferred to Node.

Since you're using the LTS branch (v8.x), there is no ES6 support, hence the build error. Anyone using v10.11+ wouldn't have seen it.

Will patch and push the latest version now.

leebenson commented 5 years ago

Fixed in 3.3.0

Try this (in Ubuntu - for Windows, download/unpack the tar manually):

wget -qO- https://github.com/leebenson/reactql/archive/3.3.0.tar.gz | tar xvz
cd reactql-3.3.0
npm i
npm start
jimjamdev commented 5 years ago

Awesome, I'll give it another spin after work and check.

Also, i'll maybe mention as well, it might be worth updating to styled-components 4.0

leebenson commented 5 years ago

I'm certainly planning on bumping to Styled Components v4. It's still in beta and would require some code changes, so it's something I'll look at in the coming weeks.