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

1.1.2 outputs .json file instead of .js file #47

Open
turnerhayes opened this issue Jul 27, 2017 · 12 comments
Open

1.1.2 outputs .json file instead of .js file #47

turnerhayes opened this issue Jul 27, 2017 · 12 comments

Comments

@turnerhayes
Copy link

It appears that something between 1.1.0 and 1.1.2 has changed the output from a .js file to a .json file. This is what appears in the htmlWebpackPlugin variable in each version:

1.1.0:

{
"files": {
	"publicPath": "/static/",
	"chunks": {
		"webpackManifest": {
			"size": 0,
			"entry": "/static/js/webpackManifest-d41d8cd98f00b204e980.js",
			"hash": "d41d8cd98f00b204e980",
			"css": []
		},
		"vendor": {
			"size": 2626754,
			"entry": "/static/js/vendor-392d99b5276c8459890d.js",
			"hash": "392d99b5276c8459890d",
			"css": [
				"/static/css/vendor-92e4a31a26173772f8ef.css"
			]
		},
		"main": {
			"size": 147201,
			"entry": "/static/js/main-819a8466ef5c6c51cd36.js",
			"hash": "819a8466ef5c6c51cd36",
			"css": [
				"/static/css/main-92e4a31a26173772f8ef.css"
			]
		}
	},
	"js": [
		"/static/js/webpackManifest-d41d8cd98f00b204e980.js",
		"/static/js/vendor-392d99b5276c8459890d.js",
		"/static/js/main-819a8466ef5c6c51cd36.js"
	],
	"css": [
		"/static/css/vendor-92e4a31a26173772f8ef.css",
		"/static/css/main-92e4a31a26173772f8ef.css"
	],
	"webpackManifest": ""
},
"options": {
	"template": "/projects/websites/quintro/node_modules/html-webpack-plugin/lib/loader.js!/projects/websites/quintro/server/views/index.template.ejs",
	"filename": "../server/views/index.hbs",
	"hash": false,
	"inject": false,
	"compile": true,
	"favicon": false,
	"minify": {
		"collapseBooleanAttributes": true,
		"collapseWhitespace": true
	},
	"cache": true,
	"showErrors": true,
	"chunks": "all",
	"excludeChunks": [],
	"title": "Quintro",
	"xhtml": false,
	"alwaysWriteToDisk": true,
	"staticContentURL": "https://localhost:7200"
}
}

1.1.2:

{
"files": {
	"publicPath": "/static/",
	"chunks": {
		"webpackManifest": {
			"size": 0,
			"entry": "/static/webpackManifest.json",
			"hash": "d41d8cd98f00b204e980",
			"css": []
		},
		"vendor": {
			"size": 2626754,
			"entry": "/static/js/vendor-392d99b5276c8459890d.js",
			"hash": "392d99b5276c8459890d",
			"css": [
				"/static/css/vendor-6946c2dfdd053e5b7448.css"
			]
		},
		"main": {
			"size": 147201,
			"entry": "/static/js/main-819a8466ef5c6c51cd36.js",
			"hash": "819a8466ef5c6c51cd36",
			"css": [
				"/static/css/main-6946c2dfdd053e5b7448.css"
			]
		}
	},
	"js": [
		"/static/webpackManifest.json",
		"/static/js/vendor-392d99b5276c8459890d.js",
		"/static/js/main-819a8466ef5c6c51cd36.js"
	],
	"css": [
		"/static/css/vendor-6946c2dfdd053e5b7448.css",
		"/static/css/main-6946c2dfdd053e5b7448.css"
	],
	"webpackManifest": ""
},
"options": {
	"template": "/projects/websites/quintro/node_modules/html-webpack-plugin/lib/loader.js!/projects/websites/quintro/server/views/index.template.ejs",
	"filename": "../server/views/index.hbs",
	"hash": false,
	"inject": false,
	"compile": true,
	"favicon": false,
	"minify": {
		"collapseBooleanAttributes": true,
		"collapseWhitespace": true
	},
	"cache": true,
	"showErrors": true,
	"chunks": "all",
	"excludeChunks": [],
	"title": "Quintro",
	"xhtml": false,
	"alwaysWriteToDisk": true,
	"staticContentURL": "https://localhost:7200"
}
}

Since I have a custom template for HTMLWebpackPlugin that iterates over the js files, this throws an error because it's trying to load a JSON file as a <script src> rather than a .js file.

@MatTheCat
Copy link

I guess it comes from 1.1.0...1.1.1#diff-85d664d316c6e5648ad0e423981ca864R42

@MildC
Copy link

MildC commented Jul 31, 2017

it also includes the json file on the page even inlineManifest set to false

@patroza
Copy link

patroza commented Aug 6, 2017

Same problem here.

@leebenson
Copy link

Author of https://reactql.org here - same thing is happening in my kit.

Snippet of 1.1.0 (Webpack 2):

<script type="text/javascript" src="/manifest.d41d8cd98f00b204e980.js"></script><script type="text/javascript" src="/vendor.27df1bed7aa4091f008c.js"></script><script type="text/javascript" src="/browser.3f9afcf85183d7fd6943.js"></script></body>
</html>

Now with 1.1.2 (Webpack 3):

<script type="text/javascript" src="/../chunk-manifest.json"></script><script type="text/javascript" src="/vendor.a757c8101d8f95913969.js"></script><script type="text/javascript" src="/browser.3bf79d2a482fc7de3464.js"></script></body>

In the browser:

screen shot 2017-08-06 at 14 50 27

@MatTheCat
Copy link

@diurnalist ? @TuckerCowie ? Someone? It's been 23 days this plugin no longer work. You could close this issue, #48, #49 and #50 in one row!

sigerello added a commit to sigerello/chunk-manifest-webpack-plugin that referenced this issue Aug 18, 2017
@sigerello
Copy link

Yes, it's broken after #29.

@leebenson
Copy link

Is there any motivation to fix this plugin? If #29 introduced the bug, any plans to roll it back?

This one issue renders this plugin defunct.

@Fireworks
Copy link

I don't understand the purpose of that patch, but maybe I'm missing something. Regardless, this also broke our app as well. Will lock version for now, but seems like a rollback is needed.

sunyang713 added a commit to sunyang713/chunk-manifest-webpack-plugin that referenced this issue Sep 9, 2017
@DimitarNestorov
Copy link

For those that haven't done this themselves already:
https://www.npmjs.com/package/@codemotion/chunk-manifest-webpack-plugin

Go ahead and paste this in your terminal:

npm uninstall chunk-manifest-webpack-plugin
npm install -D -E @codemotion/chunk-manifest-webpack-plugin

Or if you're using yarn:

yarn remove chunk-manifest-webpack-plugin
yarn add -D -E @codemotion/chunk-manifest-webpack-plugin

And one more thing. Add @codemotion/ in the require statement like so:

const ChunkManifestPlugin = require(`@codemotion/chunk-manifest-webpack-plugin`);

Until this problem gets fixed here I propose that you use the fork I made.

Also if you want any change to the plugin feel free to post an issue/pull request in the repo.

@leebenson
Copy link

Thanks @DimitarNestorov - very helpful. I'll switch out to your version in the next ReactQL release.

@sunyang713
Copy link

sunyang713 commented Oct 11, 2017

For others who prefer to rely on their own dependencies instead, you can easily fork this project, make the same change as #52, and merge your change into your master branch. Then, in your project that uses chunk-manifest-webpack-plugin, you can install your own fork. i.e.:

$ npm install --save-dev https://github.com/{your-username}/chunk-manifest-webpack-plugin

For example (if you wanted to use my fork),

$ npm install --save-dev https://github.com/sunyang713/chunk-manifest-webpack-plugin

You don't have to change your require statement afterwards; it can remain exactly the same:

// webpack.config.js
. . .
var ChunkManifestPlugin = require('chunk-manifest-webpack-plugin')
. . .

@wvankuipers
Copy link

@diurnalist Are there any plans to resolve this issue? People switching to the backup repo is a bad thing as it will be hard to get these people switching back once this issue is resolved...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

10 participants