question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Cannot read property 'type' of undefined

See original GitHub issue

Hello, I use “extract-svg-sprite-webpack-plugin” as described in the example and get the following error:

(node:10720) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'type' of undefined
    at Function.replaceInModuleSource (/home/user/Embedded/7490/HTML_vr9_build/node_modules/extract-svg-sprite-webpack-plugin/lib/utils/replacer.js:62:16)
    at s.cssModules.forEach.m (/home/user/Embedded/7490/HTML_vr9_build/node_modules/extract-svg-sprite-webpack-plugin/lib/plugin.js:66:32)
    at Array.forEach (<anonymous>)
    at sprite.symbols.forEach.s (/home/user/Embedded/7490/HTML_vr9_build/node_modules/extract-svg-sprite-webpack-plugin/lib/plugin.js:65:34)
    at Array.forEach (<anonymous>)
    at result.forEach (/home/user/Embedded/7490/HTML_vr9_build/node_modules/extract-svg-sprite-webpack-plugin/lib/plugin.js:63:32)
    at Array.forEach (<anonymous>)
    at compileSprites.then.result (/home/user/Embedded/7490/HTML_vr9_build/node_modules/extract-svg-sprite-webpack-plugin/lib/plugin.js:62:22)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

In cssModules of symbols are undefined values (line: 65):

s.cssModules.forEach(m => {

I use the following webpack plugins:

  • VueLoaderPlugin
  • MiniCssExtractPlugin
  • HtmlWebpackPlugin

and loader for css:

  • MiniCssExtractPlugin.loader
  • css-loader
  • SpritePlugin.cssLoader
  • postcss-loader
  • sass-loader

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:11
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Tommyttocommented, Jul 17, 2019

May be it will be helpful. I am using dynamic imports, mini-css-extract-plguin, sass, html webpack plugin

1reaction
Tommyttocommented, Jul 17, 2019

I have the same problem without css modules

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: Cannot read property 'type' of undefined ...
Your clicking action returns a function and you are dispatching that function with this.props.dispatch(clicking(isClicking)); .
Read more >
Uncaught TypeError: Cannot read property of undefined In
JavaScript TypeError is thrown when an operand or argument passed to a function is incompatible with the type expected by that operator or...
Read more >
[SOLVED] Cannot Read Property of Undefined in JavaScript
The “cannot read property of undefined” error occurs when you attempt to access a property or method of a variable that is undefined...
Read more >
TypeError: Cannot read property 'type' of undefined at Object ...
Current Behavior On some computers of my team, people are having this error : (node:10932) UnhandledPromiseRejectionWarning: TypeError: ...
Read more >
How to Avoid the Infamous "Cannot read properties of ... - Bitovi
Interpreting undefined or null as subtypes of all other types can lead to runtime problems. For example, if you try to get the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found