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

2.0.0-rc2 doesn't build with webpack/babel #30

Closed
Jezzamonn opened this issue Feb 23, 2019 · 1 comment
Closed

2.0.0-rc2 doesn't build with webpack/babel #30

Jezzamonn opened this issue Feb 23, 2019 · 1 comment

Comments

@Jezzamonn
Copy link

Been using random-js with webpack/babel without problems for a while but the new version is causing errors in babel for me

ERROR in ./node_modules/random-js/dist/random-js.mjs
    Module parse failed: Unexpected token (459:10)
    You may need an appropriate loader to handle this file type.
    |         }
    |     }
    |     catch {
    |         // nothing to do here
    |     }
     @ ./js/controller.js 9:16-36
     @ ./js/main.js

Switching back an older version fixes it for me.

So far I've just imported it and new'd it up, otherwise haven't done much else

import { Random } from "random-js";

const random = new Random();

// other, non random related code?

The config part of my webpack.config.js file looks like

{
    module: {
        loaders: [
            {
                test: /\.js$/,
                loader: 'babel-loader',
                query: {
                    presets: ['env']
                }
            }
        ]
    },
    stats: {
        colors: true
    },
    entry: './js/main.js',
    output: {
        path: path.resolve(__dirname, 'build'),
        filename: 'main.bundle.js'
    },
    devtool: 'source-map'
}

Let me know if you need any more info!

@Jezzamonn Jezzamonn changed the title Doesn't build with 2.0.0-rc2 2.0.0-rc2 doesn't build with webpack/babel Feb 23, 2019
@ckknight
Copy link
Owner

Ah, darn. My guess is that it's the catch: https://github.com/tc39/proposal-optional-catch-binding

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