Closed mtsewrs closed 8 years ago
Also, when running in production it seems that es7 decorators are not working...
edit: although works by adding ?stage=0
Try switching back to commit bfc71981a7008adf007e7b5a94c17f28a0a12adb or less - Or try the new https://github.com/jedwards1211/meteor-webpack-react/tree/webpack-meteor-tools branch.
Or: merge the PR's of haydnhkim
#91 and #98
Currently master is broken due to incomplete SSR additions.
The webpack-meteor-tools branch should have this problem as well -- I need to figure out a different hack for server side source maps/original files in the debugger.
Also the first and so far only release shouldn't have this problem
Okay, this is now fixed in the latest version of the branch: https://github.com/jedwards1211/meteor-webpack-react/tree/webpack-meteor-tools
I figured out a way to support server-side source maps without having to require
in the server bundle.
@jedwards1211 Alright, progress! Are you going to merge it soon?
We'll see...I've been terribly busy lately
I'm still confused how ?stage=0
fixes this problem, several people have reported that. Do the login buttons actually show up in the webpage or does it simply not error out?
@jedwards1211 It's easy:
Babel config in webpack.config.dev.js
: stage=0, transform plugins ...
Babel config in webpack.config.prod.js
: None
Babel config in common webpack.config.js
: Default (stage=2)
decorators are stage 1 - so when build prod decorators did not work (used for reactMixin
)
Adding stage=0 to webpack.config.js
adds decorator support for production builds
EDIT: But you are right - this shouldn't fix any "Template" is undefined error. The babel error appeared due to the move of babel config to config.dev. The "Template" error is fixed with #91
Okay, I finally revisited this. I was confused since I never use Blaze -- Template
isn't available on the server side, so I got rid of the PR that monkeypatched it for the sake of SSR (which was ruining the client side anyway due to var
hoisting, which I didn't think about.
In short, wrap all references to Template
in Meteor.isClient
checks.
Also, I revamped how the webpack configs are created to use webpack-merge
and babel options in the query
parameter as necessary.
Cheers!
Getting this error running dev, using react 0.14.