ardatan / ardatan/meteor-webpack

withTracker is `undefined` starting from react-meteor-data@2.0.1

Open
#90 2 comments 4 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
123
Forks
28
PR merge metrics
No merged PRs in 30d

Description

It works with react-meteor-data@1.0.0 but starting from 2.0.1 `withTracker` is `undefined`.
Also react-meteor-data@2.0.1 works without meteor-webpack package.
```
import { withTracker } from 'meteor/react-meteor-data';
console.log(withTracker); // undefined
```

```
// webpack.config.js

const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const meteorExternals = require('webpack-meteor-externals');
const path = require('path');

const clientConfig = {
entry: './client/index.js',
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
configFile: path.resolve(__dirname, './.babelrc'),
},
},
},
{
test: /\.s[ac]ss$/i,
loader: [
'style-loader',
{
loader: 'css-loader',
options: {
modules: {
auto: true,
localIdentName: '[path][name]__[local]',
},
},
},
{
loader: 'sass-loader',
},
],
},
{
test: /\.(png|svg|jpg|gif)$/,
use: ['file-loader'],
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.(woff|woff2|eot|ttf|otf)$/,
use: ['file-loader'],
},
],
},
devtool: 'eval-source-map',
output: {
publicPath: '/',
},
resolve: {
alias: {
'/imports': path.resolve(__dirname, './imports'),
},
},
plugins: [
new HtmlWebpackPlugin({
template: './client/index.html',
}),
new webpack.HotModuleReplacementPlugin(),
],
externals: [meteorExternals()],
devServer: {
hot: true,
},
};

const serverConfig = {
entry: ['./server/main.js'],
target: 'node',
devServer: {
hot: true,
},
externals: [meteorExternals()],
resolve: {
alias: {
'/imports': path.resolve(__dirname, './imports'),
},
},
};

module.exports = [clientConfig, serverConfig];

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the import from client/index.js with react-meteor-data@1.0.0 and 2.0.1, using the externals configuration in webpack.config.js. Compare how the two versions expose withTracker and how meteor-webpack is involved; the issue is done when the package works with the reported configuration and the version-related behavior is covered by a regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react, webpack
Domain
build-system, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.