rewire-webpack icon indicating copy to clipboard operation
rewire-webpack copied to clipboard

Deprecation warnings in browser console

Open bultas opened this issue 11 years ago • 8 comments

Hi,

Firstly, I would like to thank you for very useful module.

I'm using rewire with webpack bundle, but after upgrade webpack to version 1.4.13 I'm getting some warning messages in console.log

Warning 1:

'window.webkitStorageInfo' is deprecated. Please use 'navigator.webkitTemporaryStorage' or 'navigator.webkitPersistentStorage' instead.

Warning 2:

'webkitIndexedDB' is deprecated. Please use 'indexedDB' instead.

But everything seems that works properly yet. But I write better now than when it's too late.

bultas avatar Nov 13 '14 10:11 bultas

Thanks for the notification. But it seems to me that the error messages are not related to rewire-webpack because I don't use these properties. There are actual just a few lines of code of rewire-webpack that run in the browser. The main part is done during webpack compilation.

Both warnings are caused by the same problem: I guess you're using some browser-based database (Probably level.js or indexedup?) which tries to access deprecated properties.

jhnns avatar Nov 13 '14 10:11 jhnns

It's interesting .. because if i dont use rewire in my test file warning disappears..

Maybe can be problem with phantomJS which I'm using to open final test bundle.. (but with warnings only if i use rewire)

hmm .. i will have to explore more deeply..

bultas avatar Nov 13 '14 11:11 bultas

The warnings appears at getImportGlobalsSrc function on line 28 https://github.com/jhnns/rewire/blob/master/lib/getImportGlobalsSrc.js#L28

bultas avatar Nov 13 '14 12:11 bultas

Ah, that makes sense... the warnings are outputted when such a property is accessed. It's safe to ignore these warnings.

Unfortunately rewire still needs to access these variables because there might be code mocking these properties although they are deprecated now.

jhnns avatar Nov 17 '14 15:11 jhnns

Is this still an issue? I'll try it out now on 1.7.*. If ever, I'll update the outcome.

srph avatar Apr 07 '15 18:04 srph

Yep, it will not go away soon. rewire needs to access these properties...

jhnns avatar Apr 13 '15 20:04 jhnns

Alright :smile:! But these are merely warnings and do not affect test results, right?

srph avatar Apr 13 '15 21:04 srph

Yep, they occur because the browser thinks that your application is accessing these deprecated properties.

jhnns avatar Apr 13 '15 22:04 jhnns