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

Created on 4 Jul 2016  路  8Comments  路  Source: MrRio/jsPDF

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'
            },
        ]
    }
};

Most helpful comment

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

All 8 comments

Just confirming that I have the same problem

Confirmed, same issue here

Seems to be addressed, fixed and already merged in https://github.com/MrRio/jsPDF/pull/774. But it's not released yet.

I'm having the same Issue here. When are you releasing it? Im using npm

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

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

If you are installing from npm, one (ugly) way to get around this until there is a release with a fix (see #744):

In your package.json

"dependencies": {
    "jspdf": "git://github.com/MrRio/jsPDF/#76edb3387cda3d5292e212765134b06150030364"
}

So you're pinning to a working commit, incurring some debt to remember to change it back to the next release.

This is now fixed in 1.3.x 馃憤 https://github.com/MrRio/jsPDF/issues/506

Was this page helpful?
0 / 5 - 0 ratings

Related issues

centurianii picture centurianii  路  4Comments

palmoni picture palmoni  路  4Comments

yankeeBrit picture yankeeBrit  路  3Comments

mellisa0109 picture mellisa0109  路  3Comments

arulmb0136 picture arulmb0136  路  4Comments