We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm having a bit of trouble deploying my webpack 2 app to Heroku. It seems like my app, using Underscore Templates in with my HTML is having trouble.
When I deploy to Heroku I get: ERROR in Template execution failed: ReferenceError: __webpack_require__ is not defined
ERROR in Template execution failed: ReferenceError: __webpack_require__ is not defined
My Repo is here: https://github.com/CheezItMan/tasklist-js
My webpack.config.js is:
var path = require('path'); var ExtractTextPlugin = require('extract-text-webpack-plugin'); var webpack = require('webpack'); var HTMLWebpackPlugin = require('html-webpack-plugin'); const DEVELOPMENT = process.env.NODE_ENV === 'development'; const PRODUCTION = process.env.NODE_ENV === 'production'; var entry = PRODUCTION ? './src/app.js' : ['./src/app.js', 'webpack/hot/dev-server', 'webpack-dev-server/client?https://localhost:8080' ]; var plugins = PRODUCTION ? [ new webpack.LoaderOptionsPlugin({ minimize: false, debug: false }), new ExtractTextPlugin('style-[contenthash:10].css'), new HTMLWebpackPlugin({ template: 'index.html' }) ] : [ new webpack.HotModuleReplacementPlugin(), new ExtractTextPlugin('styles.scss') ]; plugins.push( new webpack.DefinePlugin({ DEVELOPMENT: JSON.stringify(DEVELOPMENT), PRODUCTION: JSON.stringify(PRODUCTION) }) ); plugins.push ( new webpack.ProvidePlugin({ "$": 'jquery', "jQuery": 'jquery', 'window.jQuery': 'jquery' }) ); const cssIdentifier = PRODUCTION ? '[hash:base64:10]' : '[path][name]---[local]'; const cssLoader = PRODUCTION ? ExtractTextPlugin.extract({ loader: 'css-loader?minimize&localIdentName=' + cssIdentifier }) : ['style-loader', 'css-loader?localIdentName=' + cssIdentifier]; module.exports = { devtool: 'source-map', entry: entry, plugins: plugins, output: { path: path.join(__dirname, 'dist'), publicPath: PRODUCTION ? '/' : '/dist/', filename: PRODUCTION ? 'bundle.[hash:12].min.js' : 'bundle.js' }, module: { loaders: [{ test: /\.js$/, loaders: ['babel-loader'], exclude: /node_modules/ }, { test: /\.(png|jpg|gif)$/, loaders: ['url-loader?limit=10000&name=images/[hash:12].[ext]'], exclude: '/node_modules/' }, { test: /\.(css|scss)$/, loaders: cssLoader, exclude: /node_modules/ }, { test: /\.html$/, loader: "underscore-template-loader", exclude: /node_modules/, query: { engine: 'lodash', } } ]} };
The text was updated successfully, but these errors were encountered:
I can see you removed: underscore-template-loader, did that solve your issue?
underscore-template-loader
One thing you can do is be more specific with your test regex so you don't include index.html
index.html
Sorry, something went wrong.
Closing this down, as it looks like you resolved your issue
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
No branches or pull requests
I'm having a bit of trouble deploying my webpack 2 app to Heroku. It seems like my app, using Underscore Templates in with my HTML is having trouble.
When I deploy to Heroku I get:
ERROR in Template execution failed: ReferenceError: __webpack_require__ is not defined
My Repo is here: https://github.com/CheezItMan/tasklist-js
My webpack.config.js is:
The text was updated successfully, but these errors were encountered: