webpack-contrib / json-loader

json loader module for webpack - UNMAINTAINED

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Json encoding

dikond opened this issue · comments

Hi folks,

I wanted to share one concern with you.
Our .json file couldn't be processed due to some issue with Unicode encoding. Apparently, we had a Line Separator char in the string literal. It was invisible in our text editors and we found with an empirical approach. I found that answer on SO that explains why javascript fails to parse it.
I just think that it would be great to automatically escape this char in json-loader somehow. Or let a user know about the possible problem. What do you think?

I'd like to echo the above comment and provide a minimal example demonstrating the problem:
https://github.com/dwbruhn/webpack-json-example

Looks like this issue has been open for a while...will someone be looking into it?

Oh, looks like it was fixed but never published!
3b3069f

Can someone publish it, please? @sokra

@dwbruhn - This plugins functionality is the default in Webpack > 2.

Hi @d3viant0ne, but this is clearly a bug. Is there some blocker to publishing the fix?

My point is, if you are using webpack 2, you don't need this plugin.

If you are using webpack 1.x, it's not going to be supported for long & I will deprecate this the second it no longer is.

Fix, no fix, new version .... the right answer here is to use Webpack's native support for json and not a really soon to be moth-balled plugin.

I don't have a problem pushing a new version. Just making it clear this is likely to be the last release.

Hi @d3viant0ne, right, but it seems that webpack's "native support for json" simply consists of including this module in its package.json.

And the github link on the npm page for the module redirects here.

You can see in my example that I have no webpack plugins configured at all, and yet the problem appears.

Happy to be corrected, though, if I'm missing something!

iirc it's a lack of documentation issue in regards to Webpack's json support.

I'll get a version out as soon as I get back to my desk & see about getting the documentation issue resolved this weekend.

json-loader@0.5.5 is available on npm.

Change can be found here: https://github.com/webpack-contrib/json-loader/blob/master/CHANGELOG.md#055-2017-07-22

Thanks! 👍