Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Cannot read property 'has' of undefined #186

Open
blueror0105 opened this issue May 15, 2022 · 0 comments
Open

Cannot read property 'has' of undefined #186

blueror0105 opened this issue May 15, 2022 · 0 comments

Comments

@blueror0105
Copy link

blueror0105 commented May 15, 2022

Hello.
I hope you are doing well.
When I configured lodash webpack plugin and build it in runtime, I got below error.
`
ERROR in ./assets/js/theme/account.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: D:\work\node\cornerstone\assets\js\theme\account.js: Cannot read property 'has' of undefined
at resolvePath (D:\work\node\cornerstone\node_modules\babel-plugin-lodash\lib\importModule.js:22:24)
at importModule (D:\work\node\cornerstone\node_modules\babel-plugin-lodash\lib\importModule.js:36:53)
at memoized (D:\work\node\cornerstone\node_modules\lodash\memoize.js:62:23)
at D:\work\node\cornerstone\node_modules\babel-plugin-lodash\lib\index.js:217:63
at arrayEach (D:\work\node\cornerstone\node_modules\lodash_arrayEach.js:15:9)
at forEach (D:\work\node\cornerstone\node_modules\lodash\forEach.js:38:10)
at D:\work\node\cornerstone\node_modules\babel-plugin-lodash\lib\index.js:193:30
at arrayEach (D:\work\node\cornerstone\node_modules\lodash_arrayEach.js:15:9)
at forEach (D:\work\node\cornerstone\node_modules\lodash\forEach.js:38:10)
at D:\work\node\cornerstone\node_modules\babel-plugin-lodash\lib\index.js:181:28

ERROR in ./assets/js/theme/cart.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: D:\work\node\cornerstone\assets\js\theme\cart.js: Cannot read property 'has' of undefined
at resolvePath (D:\work\node\cornerstone\node_modules\babel-plugin-lodash\lib\importModule.js:22:24)
at importModule (D:\work\node\cornerstone\node_modules\babel-plugin-lodash\lib\importModule.js:36:53)
at memoized (D:\work\node\cornerstone\node_modules\lodash\memoize.js:62:23)
at D:\work\node\cornerstone\node_modules\babel-plugin-lodash\lib\index.js:203:62
at arrayEach (D:\work\node\cornerstone\node_modules\lodash_arrayEach.js:15:9)
at forEach (D:\work\node\cornerstone\node_modules\lodash\forEach.js:38:10)
at D:\work\node\cornerstone\node_modules\babel-plugin-lodash\lib\index.js:193:30
at arrayEach (D:\work\node\cornerstone\node_modules\lodash_arrayEach.js:15:9)
at forEach (D:\work\node\cornerstone\node_modules\lodash\forEach.js:38:10)
at D:\work\node\cornerstone\node_modules\babel-plugin-lodash\lib\index.js:181:28

ERROR in ./assets/js/theme/common/carousel/utils/activatePlayPauseButton.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: D:\work\node\cornerstone\assets\js\theme\common\carousel\utils\activatePlayPauseButton.js: Cannot read property 'has' of undefined
at resolvePath (D:\work\node\cornerstone\node_modules\babel-plugin-lodash\lib\importModule.js:22:24)
at importModule (D:\work\node\cornerstone\node_modules\babel-plugin-lodash\lib\importModule.js:36:53)
at memoized (D:\work\node\cornerstone\node_modules\lodash\memoize.js:62:23)
at D:\work\node\cornerstone\node_modules\babel-plugin-lodash\lib\index.js:203:62
at arrayEach (D:\work\node\cornerstone\node_modules\lodash_arrayEach.js:15:9)
at forEach (D:\work\node\cornerstone\node_modules\lodash\forEach.js:38:10)
at D:\work\node\cornerstone\node_modules\babel-plugin-lodash\lib\index.js:193:30
at arrayEach (D:\work\node\cornerstone\node_modules\lodash_arrayEach.js:15:9)
at forEach (D:\work\node\cornerstone\node_modules\lodash\forEach.js:38:10)
at D:\work\node\cornerstone\node_modules\babel-plugin-lodash\lib\index.js:181:28
`

Also I confiugred lodash-webpack-plugin in my webpack.js as below as you recommend.
new LodashModuleReplacementPlugin({ 'collections': true, 'paths': true }),

But I still get the same error.
Can anyone help me to resolve it?

I am using node 14.17.01 and npm 6.14.13

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

No branches or pull requests

1 participant