Open evelant opened 7 years ago
It's happening because Isobuild transpiles import
statements into stuff that's not webpack-compatible. I don't approve of much of anything isobuild does.
You would be able to npm install --save meteor/react-packages#react@15.0.1
except that react-packages
doesn't provide a version
in its package.json
. One option is to clone the react-meteor-data
package using git subtree
and import from that folder instead. I'll try to get them to add a proper version to package.json
...
I might be able to figure out a way to de-transpile isobuild's module statements though...
As an easy workaround I just copied the code for react-meteor-data from here https://github.com/meteor/react-packages/tree/devel/packages/react-meteor-data into my project since it is quite simple. It builds fine under webpack with the meteor-imports-webpack-plugin.
@fignuts yeah that works too. I only suggested using git subtree
because you'd be able to pull updates from their repo.
I was almost tempted to preemptively start publishing a react-meteor-data
npm package 😸
@fignuts okay, I created a react-meteor-data
npm package. Now you should just be able to npm i --save react-meteor-data react-addons-pure-render-mixin
:)
Awesome! Thanks!
When I do
npm install --save-dev react-meteor-data react-addons-pure-render-mixin
I get
ReferenceError: Tracker is not defined MeteorDataManager.calculateData webpack:///./~/react-meteor-data/lib/ReactMeteorData.js?:93:26
@java99
I had to add var { Tracker } = Package.tracker
at the top of node_modules/react-meteor-data/lib/ReactMeteorData.js
. This is a hacky fix. Hopefully the NPM package could be republished to include this dependency or we could find some alternative solution.
@kawikadkekahuna I just published a fix for that, could you install the latest version of react-meteor-data
(0.2.10) and let me know how it works?
@jedwards1211
Awesome. Fixed now. Thanks for updating it.
@kawikadkekahuna you're welcome!
Add react-meteor-data plugin to meteor and react-addons-pure-render-mixing to package.json and the following happens on the client if you try to import from meteor/react-meteor-data:
Looks like meteor packages can't resolve npm packages. I'm not sure how to fix this.