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

Receiving warning when building project: "It seems you're using webpack >= v2.0.0, which includes native support for JSON." #7095

Closed
alexjlockwood opened this issue Jul 22, 2017 · 13 comments · Fixed by #7098

Comments

@alexjlockwood
Copy link

I have recently started getting the warning below when building my project (https://github.com/alexjlockwood/ShapeShifter).

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.2.3
node: 8.1.1
os: darwin x64
@angular/animations: 4.3.1
@angular/cdk: 2.0.0-beta.8
@angular/common: 4.3.1
@angular/compiler: 4.3.1
@angular/core: 4.3.1
@angular/flex-layout: 2.0.0-beta.8
@angular/forms: 4.3.1
@angular/http: 4.3.1
@angular/material: 2.0.0-beta.8
@angular/platform-browser: 4.3.1
@angular/platform-browser-dynamic: 4.3.1
@angular/router: 4.3.1
@angular/service-worker: 1.0.0-beta.16
@angular/cli: 1.2.3
@angular/compiler-cli: 4.3.1
@angular/language-service: 4.3.1

Logs

WARNING in ./~/css-select/lib/procedure.json
(Emitted value instead of an instance of Error) ⚠️  JSON Loader

It seems you're using webpack >= v2.0.0, which includes native support for JSON.
Please remove this loader from webpack.config.js as it isn't needed anymore and
is deprecated. See the v1.0.0 -> v2.0.0 migration guide for more information
(https://webpack.js.org/guides/migrating/#json-loader-is-not-required-anymore)

 @ ./~/css-select/lib/compile.js 10:18-45
 @ ./~/css-select/index.js
 @ ./src/app/scripts/svgo/lib/jsAPI.ts
 @ ./src/app/scripts/svgo/lib/svg2js.ts
 @ ./src/app/scripts/svgo/svgo.ts
 @ ./src/app/scripts/svgo/index.ts
 @ ./src/app/scripts/import/SvgLoader.ts
 @ ./src/app/scripts/import/index.ts
 @ ./src/app/services/clipboard.service.ts
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts

WARNING in ./~/css-tree/dist/default-syntax.json
(Emitted value instead of an instance of Error) ⚠️  JSON Loader

It seems you're using webpack >= v2.0.0, which includes native support for JSON.
Please remove this loader from webpack.config.js as it isn't needed anymore and
is deprecated. See the v1.0.0 -> v2.0.0 migration guide for more information
(https://webpack.js.org/guides/migrating/#json-loader-is-not-required-anymore)

 @ ./~/css-tree/lib/syntax/default.js 1:11-32
 @ ./~/css-tree/lib/index.js
 @ ./src/app/scripts/svgo/plugins/inlineStyles.ts
 @ ./src/app/scripts/svgo/svgo.ts
 @ ./src/app/scripts/svgo/index.ts
 @ ./src/app/scripts/import/SvgLoader.ts
 @ ./src/app/scripts/import/index.ts
 @ ./src/app/services/clipboard.service.ts
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts

WARNING in ./~/entities/maps/xml.json
(Emitted value instead of an instance of Error) ⚠️  JSON Loader

It seems you're using webpack >= v2.0.0, which includes native support for JSON.
Please remove this loader from webpack.config.js as it isn't needed anymore and
is deprecated. See the v1.0.0 -> v2.0.0 migration guide for more information
(https://webpack.js.org/guides/migrating/#json-loader-is-not-required-anymore)

 @ ./~/entities/lib/encode.js 1:31-58
 @ ./~/entities/index.js
 @ ./~/dom-serializer/index.js
 @ ./~/domutils/lib/stringify.js
 @ ./~/domutils/index.js
 @ ./~/css-select/index.js
 @ ./src/app/scripts/svgo/lib/jsAPI.ts
 @ ./src/app/scripts/svgo/lib/svg2js.ts
 @ ./src/app/scripts/svgo/svgo.ts
 @ ./src/app/scripts/svgo/index.ts
 @ ./src/app/scripts/import/SvgLoader.ts
 @ ./src/app/scripts/import/index.ts
 @ ./src/app/services/clipboard.service.ts
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts

WARNING in ./~/entities/maps/legacy.json
(Emitted value instead of an instance of Error) ⚠️  JSON Loader

It seems you're using webpack >= v2.0.0, which includes native support for JSON.
Please remove this loader from webpack.config.js as it isn't needed anymore and
is deprecated. See the v1.0.0 -> v2.0.0 migration guide for more information
(https://webpack.js.org/guides/migrating/#json-loader-is-not-required-anymore)

 @ ./~/entities/lib/decode.js 2:16-46
 @ ./~/entities/index.js
 @ ./~/dom-serializer/index.js
 @ ./~/domutils/lib/stringify.js
 @ ./~/domutils/index.js
 @ ./~/css-select/index.js
 @ ./src/app/scripts/svgo/lib/jsAPI.ts
 @ ./src/app/scripts/svgo/lib/svg2js.ts
 @ ./src/app/scripts/svgo/svgo.ts
 @ ./src/app/scripts/svgo/index.ts
 @ ./src/app/scripts/import/SvgLoader.ts
 @ ./src/app/scripts/import/index.ts
 @ ./src/app/services/clipboard.service.ts
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts

WARNING in ./~/entities/maps/entities.json
(Emitted value instead of an instance of Error) ⚠️  JSON Loader

It seems you're using webpack >= v2.0.0, which includes native support for JSON.
Please remove this loader from webpack.config.js as it isn't needed anymore and
is deprecated. See the v1.0.0 -> v2.0.0 migration guide for more information
(https://webpack.js.org/guides/migrating/#json-loader-is-not-required-anymore)

 @ ./~/entities/lib/encode.js 6:32-64
 @ ./~/entities/index.js
 @ ./~/dom-serializer/index.js
 @ ./~/domutils/lib/stringify.js
 @ ./~/domutils/index.js
 @ ./~/css-select/index.js
 @ ./src/app/scripts/svgo/lib/jsAPI.ts
 @ ./src/app/scripts/svgo/lib/svg2js.ts
 @ ./src/app/scripts/svgo/svgo.ts
 @ ./src/app/scripts/svgo/index.ts
 @ ./src/app/scripts/import/SvgLoader.ts
 @ ./src/app/scripts/import/index.ts
 @ ./src/app/services/clipboard.service.ts
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts

WARNING in ./~/entities/maps/decode.json
(Emitted value instead of an instance of Error) ⚠️  JSON Loader

It seems you're using webpack >= v2.0.0, which includes native support for JSON.
Please remove this loader from webpack.config.js as it isn't needed anymore and
is deprecated. See the v1.0.0 -> v2.0.0 migration guide for more information
(https://webpack.js.org/guides/migrating/#json-loader-is-not-required-anymore)

 @ ./~/entities/lib/decode_codepoint.js 1:16-46
 @ ./~/entities/lib/decode.js
 @ ./~/entities/index.js
 @ ./~/dom-serializer/index.js
 @ ./~/domutils/lib/stringify.js
 @ ./~/domutils/index.js
 @ ./~/css-select/index.js
 @ ./src/app/scripts/svgo/lib/jsAPI.ts
 @ ./src/app/scripts/svgo/lib/svg2js.ts
 @ ./src/app/scripts/svgo/svgo.ts
 @ ./src/app/scripts/svgo/index.ts
 @ ./src/app/scripts/import/SvgLoader.ts
 @ ./src/app/scripts/import/index.ts
 @ ./src/app/services/clipboard.service.ts
 @ ./src/app/app.module.ts
 @ ./src/main.ts
 @ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts
@stewones
Copy link

stewones commented Jul 22, 2017

same here.
even ejecting the cli to remove the loader. not breaks the app but shows a boring warning in browser console (angular cli 1.3.0-rc0)

@abozhinov
Copy link

Same

@vinsonio
Copy link

+1

@scotmatson
Copy link

scotmatson commented Jul 22, 2017

Having this issue on a React project after upgrading the create-react-app webpack version to the latest stable build.

Not isolated to Angular.

Upgraded multiple files related to loaders and webpack itself, did a rebuild of node_modules and everything appears to be right as rain. Sorry for adding to the noise. I suggest if this continues for others to simply do the same or to see Shywim's referenced ticket.

@Shywim
Copy link

Shywim commented Jul 22, 2017

See webpack-contrib/json-loader#57

@joshwiens
Copy link
Contributor

webpack-contrib/json-loader#57 (comment)

For reference, anything using >= webpack@2 doesn't need json-loader though to the fix that @clydin opened, removing it isn't going to completely solve the problem ( see below ).

https://github.com/webpack/webpack/blob/56b9aabc22067e5b5ccc303641ce420c60d7f389/lib/CompatibilityPlugin.js#L44-L52

In the sprit of not breaking half the internet again, I am locking json-loader until we resolve the issue upstream. It was deprecated, should be deprecated but can't be until Webpack doesn't directly delegate to it.

@stewones
Copy link

nice! the warn is gone. thx @d3viant0ne

@wal-junaid
Copy link

wal-junaid commented Jul 22, 2017

@st1s how you fix this?

@mikhael28
Copy link

mikhael28 commented Jul 23, 2017

These are my error codes:
ompiled with warnings.

../~/aws-sdk/apis/cognito-idp-2016-04-18.min.json
(Emitted value instead of an instance of Error) ⚠️ JSON Loader

It seems you're using webpack >= v2.0.0, which includes native support for JSON.
Please remove this loader from webpack.config.js as it isn't needed anymore and
is deprecated. See the v1.0.0 -> v2.0.0 migration guide for more information
(https://webpack.js.org/guides/migrating/#json-loader-is-not-required-anymore)

../~/aws-sdk/apis/cognito-idp-2016-04-18.paginators.json
(Emitted value instead of an instance of Error) ⚠️ JSON Loader

It seems you're using webpack >= v2.0.0, which includes native support for JSON.
Please remove this loader from webpack.config.js as it isn't needed anymore and
is deprecated. See the v1.0.0 -> v2.0.0 migration guide for more information
(https://webpack.js.org/guides/migrating/#json-loader-is-not-required-anymore)

../~/aws-sdk/apis/metadata.json
(Emitted value instead of an instance of Error) ⚠️ JSON Loader

It seems you're using webpack >= v2.0.0, which includes native support for JSON.
Please remove this loader from webpack.config.js as it isn't needed anymore and
is deprecated. See the v1.0.0 -> v2.0.0 migration guide for more information
(https://webpack.js.org/guides/migrating/#json-loader-is-not-required-anymore)

../~/aws-sdk/apis/sts-2011-06-15.min.json
(Emitted value instead of an instance of Error) ⚠️ JSON Loader

It seems you're using webpack >= v2.0.0, which includes native support for JSON.
Please remove this loader from webpack.config.js as it isn't needed anymore and
is deprecated. See the v1.0.0 -> v2.0.0 migration guide for more information
(https://webpack.js.org/guides/migrating/#json-loader-is-not-required-anymore)

../~/aws-sdk/apis/sts-2011-06-15.paginators.json
(Emitted value instead of an instance of Error) ⚠️ JSON Loader

It seems you're using webpack >= v2.0.0, which includes native support for JSON.
Please remove this loader from webpack.config.js as it isn't needed anymore and
is deprecated. See the v1.0.0 -> v2.0.0 migration guide for more information
(https://webpack.js.org/guides/migrating/#json-loader-is-not-required-anymore)

../~/aws-sdk/apis/cognito-identity-2014-06-30.min.json
(Emitted value instead of an instance of Error) ⚠️ JSON Loader

It seems you're using webpack >= v2.0.0, which includes native support for JSON.
Please remove this loader from webpack.config.js as it isn't needed anymore and
is deprecated. See the v1.0.0 -> v2.0.0 migration guide for more information
(https://webpack.js.org/guides/migrating/#json-loader-is-not-required-anymore)

../~/aws-sdk/apis/cognito-identity-2014-06-30.paginators.json
(Emitted value instead of an instance of Error) ⚠️ JSON Loader

It seems you're using webpack >= v2.0.0, which includes native support for JSON.
Please remove this loader from webpack.config.js as it isn't needed anymore and
is deprecated. See the v1.0.0 -> v2.0.0 migration guide for more information
(https://webpack.js.org/guides/migrating/#json-loader-is-not-required-anymore)

../~/aws-sdk/lib/region_config_data.json
(Emitted value instead of an instance of Error) ⚠️ JSON Loader

It seems you're using webpack >= v2.0.0, which includes native support for JSON.
Please remove this loader from webpack.config.js as it isn't needed anymore and
is deprecated. See the v1.0.0 -> v2.0.0 migration guide for more information
(https://webpack.js.org/guides/migrating/#json-loader-is-not-required-anymore)

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

I added the //es-line disable lines to my webpack, and I even tried just commenting out the 'test' part, but I don't even have the json loader as as a loader! These error messages are messing with my inner OCD.
screen shot 2017-07-23 at 1 26 27 pm

@mikhael28
Copy link

Nevermind, I fixed it - I added json-loader to my devDependencies, and added it as a loader alongside babel-loader in my webpack.config.js - annoying warnings begone!

@stewones
Copy link

@wal-junaid yep. just remove node_modules and issue npm install again

@stewones
Copy link

stewones commented Jul 24, 2017

this issue could be closed @alexjlockwood

@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 7, 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

Successfully merging a pull request may close this issue.

9 participants