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.

Compilation Error

See original GitHub issue

Hi @Siilwyn,

after upgrading to the latest version I realized that there is a compilation error.

Failed to compile.
static/css/main.b90420c1.css from Css Minimizer plugin
TypeError: Cannot read property 'insertAfter' of undefined
    at Array.forEach (<anonymous>)

It occurs in the following code block:

  comments.forEach(node => {
    const pairedNode = node.pairedNode;
    node.comment.remove();
    pairedNode.parent['insert' + node.insertPosition](pairedNode, node.comment);
  });

It happens in case the pairedNode has no parent. Then pairedNode.parent['insert' + node.insertPosition](pairedNode, node.comment); fails.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ano45commented, Jan 8, 2022

You made my day! Thanks a lot for the quick fix!

0reactions
Siilwyncommented, Jan 8, 2022

For posterity this is odd behaviour of the sass-loader which css-minimizer-webpack-plugin is using in the CRA and other examples posted above. SCSS parsing is pretty weird especially when nesting nodes with special comments that it keeps even in compressed mode.

Fixed in version 6.1.4

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Is a Compilation Error? (with picture) - EasyTechJunkie
A compilation error is an error in building a machine code file for a computer language. Many computer languages compile their source code ......
Read more >
Difference between Compile Time Errors and Runtime Errors
Compile-Time Errors: Errors that occur when you violate the rules of writing syntax are known as Compile-Time errors. This compiler error ...
Read more >
7.3. Compile Errors and Warnings
A compile error happens when the compiler reports something wrong with your program, and does not produce a machine-language translation.
Read more >
Reading/Fixing Compilation Errors
An attempted compile cycle with many errors can be overwhelming, but approaching the problem in a systematic way will help wade through the...
Read more >
What is a compilation error? - Quora
A compilation error is a message from your compiler that something is wrong, and it can't read your code. · In more details,...
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