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

Loading the polyfill on Chrome 67 will raise a warning #18

Closed
sylvhama opened this issue Jun 16, 2018 · 7 comments
Closed

Loading the polyfill on Chrome 67 will raise a warning #18

sylvhama opened this issue Jun 16, 2018 · 7 comments

Comments

@sylvhama
Copy link

When using this code in my project:

import promiseFinally from 'promise.prototype.finally';
promiseFinally.shim();

I will see this warning in Chrome 67.0.3396.87 console:
index.js:51 [Deprecation] Application Cache is deprecated in non-secure contexts, and will be restricted to secure contexts in M69, around September 2018. Please consider migrating your application to HTTPS, and eventually shifting over to Service Workers. See https://goo.gl/rStTGz for more details.

@ljharb
Copy link
Member

ljharb commented Jun 17, 2018

I'm not sure how that's possible; the shim isn't using appcache in any way. However, that warning only pops up on HTTP pages - your project (every project) should be on HTTPS regardless.

What's on line 51 of index.js?

@sylvhama
Copy link
Author

sylvhama commented Jun 18, 2018

I am using https://github.com/facebook/create-react-app which uses Webpack under the hood.
The details of the warning are:

(anonymous) @ index.js:51
./node_modules/object-keys/index.js @ index.js:63
__webpack_require__ @ bootstrap de4b3a93674cc1e1a28b:707
fn @ bootstrap de4b3a93674cc1e1a28b:112
./node_modules/define-properties/index.js @ index.js:3
__webpack_require__ @ bootstrap de4b3a93674cc1e1a28b:707
fn @ bootstrap de4b3a93674cc1e1a28b:112
./node_modules/promise.prototype.finally/index.js @ index.js:4
__webpack_require__ @ bootstrap de4b3a93674cc1e1a28b:707
fn @ bootstrap de4b3a93674cc1e1a28b:112
./src/scripts/appInit/polyfills.js @ polyfills.js:1
__webpack_require__ @ bootstrap de4b3a93674cc1e1a28b:707
fn @ bootstrap de4b3a93674cc1e1a28b:112
./src/scripts/appInit/index.js @ index.js:1
__webpack_require__ @ bootstrap de4b3a93674cc1e1a28b:707
fn @ bootstrap de4b3a93674cc1e1a28b:112
./src/index.js @ index.css?f255:26
__webpack_require__ @ bootstrap de4b3a93674cc1e1a28b:707
fn @ bootstrap de4b3a93674cc1e1a28b:112
0 @ mixins.js:29
__webpack_require__ @ bootstrap de4b3a93674cc1e1a28b:707
(anonymous) @ bootstrap de4b3a93674cc1e1a28b:805
(anonymous) @ bootstrap de4b3a93674cc1e1a28b:805

I confirm that the line import promiseFinally from 'promise.prototype.finally'; is causing this warning.

@ljharb
Copy link
Member

ljharb commented Jun 18, 2018

How can you confirm that? The error is on line 51; you’re doing an import of it on line 51?

@ljharb
Copy link
Member

ljharb commented Jun 18, 2018

Ohhhh i think i see the issue, it’s inside object-keys.

If you import object-keys instead of this package, do you get the same warning?

If so, please file an issue on https://github.com/ljharb/object-keys and i can address it there.

@sylvhama
Copy link
Author

sylvhama commented Jun 18, 2018

I am using JS modules, the line 51 mentioned in the warning is from the bundle generated by Webpack.
Anyway, if you download this project: https://codesandbox.io/s/kxp55lx90o and then do

npm install
npm start

You will see the warning in the console.
You won't see the warning on codesandbox since they are using https.

@sylvhama
Copy link
Author

sylvhama commented Jun 18, 2018

@ljharb you are right!
If I do import objectKeys from 'object-keys'; it will generate the same warning.

@sylvhama
Copy link
Author

I am closing this issue an opening a new one: ljharb/object-keys#46

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

No branches or pull requests

2 participants