question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unexpected token ; jspdf.min.js running 1.2.61 with webpack 1.13.1

See original GitHub issue

This works with jspdf.debug.js.

I am using webpack 1.13.1. to reproduce, simply install jspdf here’s my webpack.config

import path from 'path';
import webpack from 'webpack';
const DEBUG = process.argv.includes('dev');
const VERBOSE = process.argv.includes('verbose');

export default {
    entry: './src/app.js',
    output: {
        path: path.resolve('./public'),
        publicPath: '/public',
        filename: 'app.js'
    },
    devtool: DEBUG ? 'eval' : 'source-map',
    console: true,
    cache: DEBUG,
    debug: DEBUG,
    stats: {
        colors: true,
        reasons: DEBUG,
        hash: VERBOSE,
        version: VERBOSE,
        timings: true,
        chunks: VERBOSE,
        chunkModules: VERBOSE,
        cached: VERBOSE,
        cachedAssets: VERBOSE
    },
    plugins: [
        new webpack.optimize.OccurenceOrderPlugin(),
        new webpack.ProvidePlugin({
            '$': 'jquery',
            'jQuery': 'jquery',
            '_': 'underscore',
            'window.jQuery': 'jquery',
            'Promise': 'imports?this=>global!exports?global.Promise!es6-promise',
            'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch'
        }),
        ...(!DEBUG ? [
            new webpack.DefinePlugin({
                'process.env': {
                    NODE_ENV: JSON.stringify('production')
                }
            }),
            new webpack.optimize.LimitChunkCountPlugin({maxChunks: 1}),
            new webpack.optimize.DedupePlugin(),
            new webpack.optimize.UglifyJsPlugin(),
            new webpack.optimize.AggressiveMergingPlugin()
        ] : [])
    ],
    resolve: {
        root: [path.resolve(__dirname, '../bower_components'), path.resolve(__dirname, '../src')],
        extensions: ['', '.webpack.js', '.web.js', '.js', '.jsx', '.html'],
        ..
        }
    },

    module: {
        loaders: [
            {
                test: /\.jsx?$/,
                include: [path.resolve(__dirname, '../src')],
                loader: 'babel-loader'
            },
            {
                test: /\.css$/,
                loader: 'style-loader!css-loader'
            },
            {
                test: /\.less$/,
                loader: 'style!css!less'
            },
            {
                test: /\.json$/,
                loader: 'json-loader'
            }, {
                test: /\.(txt|html)$/,
                loader: 'raw-loader'
            }, {
                test: /\.(png|jpg|jpeg|gif|svg|woff|woff2)$/,
                loader: 'url-loader?limit=10000'
            }, {
                test: /\.(eot|ttf|wav|mp3)$/,
                loader: 'file-loader'
            },
        ]
    }
};

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
pdestraiscommented, Aug 1, 2016

Any idea when this issue with webpack will be fixed and released ?

1reaction
iammac360commented, Aug 31, 2016

I’ve also encountered this while using webpack any updates on this??

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unexpected token ; jspdf.min.js running 1.2.61 with webpack ...
This works with jspdf.debug.js. I am using webpack 1.13.1. to reproduce, simply install jspdf here's my webpack.config. import path from 'path'; ...
Read more >
Webpack unexpected token in JS file - Stack Overflow
I'm learning react and flux, and in lesson 1 the tutorial has failed me. This tutorial immediately breaks on 'npm start' with the...
Read more >
How to solve the 'SyntaxError: Unexpected token' issue
How to solve the 'SyntaxError: Unexpected token' issue. The recents version of `pdfjs-dist` use some modern JavaScript features. It might cause the issue ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found