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

webpackJsonp is not defined #11741

Closed
stayby opened this issue Sep 20, 2016 · 4 comments
Closed

webpackJsonp is not defined #11741

stayby opened this issue Sep 20, 2016 · 4 comments

Comments

@stayby
Copy link

stayby commented Sep 20, 2016

I copy the website and build Webpack configuration for Angular 2 apps.
then , get an error in browser 'Uncaught ReferenceError: webpackJsonp is not defined'

  • Angular version: 2.0.0

Here is my Common webpack file

var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var helpers = require('./helpers');

module.exports = {
    entry:{
        'polyfills':'./src/polyfills.ts',
        'vendor':'./src/vendor.ts',
        'app':'./src/main.ts'
    },

    resolve:{
        extensions:['','.js','.ts']
    },

    module:{
        loaders:[
            {
                test:/\.ts$/,
                loaders:['awesome-typescript-loader','angular2-template-loader']
            },
            {
                test:/\.html$/,
                loader:'html'
            },
            {
                test:/\.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,
                loader:'file?name=assets/[name].[hash].[ext]'
            },
            {
                test:/\.css$/,
                exclude:helpers.root('src','app'),
                loader:ExtractTextPlugin.extract('style','css?sourceMap')
            },
            {
                test:/\.css$/,
                include:helpers.root('src','app'),
                loader:'raw'
            }
        ]
    },

    plugins:[
        new webpack.optimize.CommonsChunkPlugin({
            name:['app','vender','polyfills']
        }),
        new HtmlWebpackPlugin({
            template:'src/index.html'
        })
    ]
};

webpack.dev.js

var webpackMerge = require('webpack-merge');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var commonConfig = require('./webpack.common.js');
var helpers = require('./helpers');

module.exports =webpackMerge(commonConfig,{
    devtool:'cheap-module-eval-source-map',

    output:{
        path:helpers.root('dist'),
        publicPath:'http://localhost:8000/',
        filenmae:'[name].js',
        chunkFilename:'[id].chunk.js'
    },

    plugins:[
        new ExtractTextPlugin('[name].css')
    ],

    devServer:{
        historyApiFallback:true,
        stats:'minimal'
    }
});
@pkozlowski-opensource
Copy link
Member

This sounds like a support request, please use an appropriate channel for those types of questions: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

@sqlsolver
Copy link

Check this webpack issue for help getting around the error.

@gmpeterson
Copy link

I am having the same issue. staybay please advise what did you do to fix this issue. Thanks!

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants