shellscape / koa-webpack

Development and Hot Reload Middleware for Koa2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[v2.0.3] Doesn't seem to pick up the babel presets.

aga5tya opened this issue · comments

I bumped to latest koa-webpack version, did the necessary changes suggested in the update notes. But can't seem to succeed with the compilation step. Doesn't seem to pick up the babel config for react(jsx). Not sure what am i missing here, But I end up with the below error.

ERROR in ../src/index.js
Module parse failed: Unexpected token (27:2)
You may need an appropriate loader to handle this file type.
| 	const app = (
| 		<ReactHotLoader>
| 			<ReduxProvider store={store}>
@ multi react-hot-loader/patch regenerator-runtime/runtime ../src/index.js
ℹ 「wdm」: Failed to compile.

Is there a config change I'm missing out with changes around babel transpilation ? Will be happy to provide more information if needed. @shellscape

[Edit]
Works fine on the previous version. So I might be missing something here.

@aga5tya thanks for the report. please fill in the issue template next time though, we ask that of everyone. the issue template has a section for // webpack.config.js and that's what we're gonna need to start to take a look at your issue.

@JounQin side note: this is probably and indicator that we should precompile in webpack-hot-client. I really didn't want to go that route (dynamic babel compilation was supposed to eliminate more issues rather than cause them), but it looks like it's needed in this context.

Is there a runnable reproduction? Actually it runs very well in my own react project https://github.com/JounQin/react-hackernews .

@JounQin @shellscape Mine is loosely based on React-Universally koa boilerplate, Will try to repro with bare one and share the repo asap.

I'm unable to reproduce this with a bare version of react-universally. I'l dig deeper with the codebase I have and figure out where or what exactly I'm missing out on. Closing this until then.

@aga5tya you can try installing webpack-hot-client from this branch https://github.com/webpack-contrib/webpack-hot-client/tree/babel-client-dist with the app from your original post. if it works, please let me know