Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing dependency? #17

Closed
vincentaudebert opened this issue Jan 26, 2017 · 3 comments
Closed

Missing dependency? #17

vincentaudebert opened this issue Jan 26, 2017 · 3 comments

Comments

@vincentaudebert
Copy link

Thanks for this excellent plugin.

I'm a bit confused I'm trying to import it in my project and I get this error:

ERROR in ./~/react-responsive-tabs/lib/index.js
Module build failed: ReferenceError: Unknown plugin "transform-class-properties" specified in "/Users/me/Development/sites/project/node_modules/react-responsive-tabs/.babelrc" at 0, attempted to resolve relative to "/Users/me/Development/sites/project/node_modules/react-responsive-tabs"

I'm using node 6.9.0 and the associated npm 3.10.8

Do I need to install babel-plugin-transform-class-properties?

Thanks.

@vincentaudebert vincentaudebert changed the title Missing dependency Missing dependency? Jan 26, 2017
@maslianok
Copy link
Owner

I'm not sure why are you receiving this error.

It should import a module that was already processed by babel.

We have two directories:
src - raw code for development (ES6, JSX etc.)
lib - code processed by Babel (ES5, ready to use code)

When you import the module to your components it should connect files from the lib folder.

How do you import the library? And can you also show your webpack config?

@vincentaudebert
Copy link
Author

vincentaudebert commented Feb 6, 2017

I import like that import Tabs from 'react-responsive-tabs';

And this is my webpack config:

const _ = require('lodash');
const path = require('path');
const glob = require('glob').sync;
const webpack = require('webpack');

const COMMON_DIR = path.join('.', 'client', 'common', 'src');

function entryPoint(filename) {
    const entryName = path.basename(filename, '.entry.js');
    return [entryName, filename];
}


function entryPoints(paths) {
    return _(glob(paths))
    .map(entryPoint)
    .fromPairs()
    .value();
}

const entryObj = entryPoints('./client/**/src/*.entry.js');
entryObj.common = ['react', 'react-dom', 'iframe-resizer/js/iframeResizer.contentWindow.min.js'];

module.exports = {
    entry: entryObj,
    resolve: {
        alias: {
            components: path.resolve(COMMON_DIR, 'components'),
            commonUtil: path.resolve(COMMON_DIR, 'util'),
        },
    },
    output: {
        path: path.join('.', 'core', 'static', 'js'),
        filename: '[name].bundle.js',
    },
    plugins: [
        new webpack.ProvidePlugin({
            fetch: 'imports?this=>global!exports?global.fetch!whatwg-fetch',
        }),
        new webpack.optimize.CommonsChunkPlugin('common', 'common.bundle.js', Infinity),
    ],
    module: {
        loaders: [
            {
                test: /\.js$/,
                loader: 'babel-loader',
            },
            {
                test: /\.jsx$/,
                loader: 'babel-loader',
            },
        ],
    },
};

Could it be because I have a vendor bundle apart?
When I installed the missing babel plugins locally it worked fine though...

@maslianok
Copy link
Owner

This error should be fixed in the latest release.
Please, let me know if this error still occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants