pimterry/loglevel

Uncaught ReferenceError: _typeof is not defined

yanerchuang opened this issue · 2 comments

Error info:
Uncaught ReferenceError: _typeof is not definedloglevel.js?16b7:22 (anonymous function)loglevel.js?16b7:10 nooploglevel.js?16b7:7 (anonymous function)vendors~main.7834f5219e6934f41c1e.js:3824 push../node_modules/_loglevel@1.7.1@loglevel/lib/loglevel.jsmain.js:859 __webpack_require__main.js:151 fnlog.js?99fd:3 (anonymous function)vendors~main.7834f5219e6934f41c1e.js:4048 push../node_modules/_webpack-dev-server@3.11.0@webpack-dev-server/client/utils/log.jsmain.js:859 __webpack_require__main.js:151 fnindex.js?777c:12 (anonymous function)index.js?http://0.0.0.0:7600:177 (anonymous function)vendors~main.7834f5219e6934f41c1e.js:3988 push../node_modules/_webpack-dev-server@3.11.0@webpack-dev-server/client/index.js?http://0.0.0.0:7600main.js:859 __webpack_require__main.js:151 fnmain.js:1613 0main.js:859 __webpack_require__main.js:46 checkDeferredModulesmain.js:1040 (anonymous function)main.js:1043 (anonymous function)
I found the issue in the two places on chrome core 39
image
image
Method 1
When i removed the code "use strict";,the issue was solved.
image
Method 2
When i use "undefined" instead of undefinedType,the issue was solved also.
image
image

Hope upgrade to solve it.

I'm fairly sure this is due to something in your build process. Having "undefined" come from a variable instead of being inline should be identical from JS's point of view, so there must be a bug elsewhere.

The only references to that error that I can find seem to be related to Babel, e.g. babel/babel#4125. Are you using Babel somewhere? It might be worth updating your version of babel, or filing a bug over there, it sounds like that is making some unsafe code transformations around typeof in some cases.

If you can show an issue where loglevel is clearly doing the wrong thing, I'm happy to look into it, but it doesn't look like that's what's happening here.

I'm going to close this for now. I'm happy to look into this further if there is a clear loglevel issue, but in general this appears to be related to babel config.