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

Cannot read property 'has' of undefined #186

@blueror0105

Description

@blueror0105

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions