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: CSS minification error: Missed semicolon. File: my-file.css

See original GitHub issue

Hello,

I’m using VueJS with bootstrap. Since the version 4.6.0 I can’t build anymore my application:

Error: CSS minification error: /home/…/my-file.css:1:141721: Missed semicolon. File: my-file.css

Same behavior if I try to build with sass or node-sass.

I found a workaround by changing the order of animation values in _progress.scss.

diff --git a/scss/_progress.scss b/scss/_progress.scss
index b48ffc4b8..a3fbecf2b 100644
--- a/scss/_progress.scss
+++ b/scss/_progress.scss
@@ -34,7 +34,7 @@

 @if $enable-transitions {
   .progress-bar-animated {
-    animation: $progress-bar-animation-timing progress-bar-stripes;
+    animation: progress-bar-stripes $progress-bar-animation-timing;

     @if $enable-reduced-motion {
       @media (prefers-reduced-motion: reduce) {

same in _spinners.scss

diff --git a/scss/_spinners.scss b/scss/_spinners.scss
index 7444ed1d1..00bb01784 100644
--- a/scss/_spinners.scss
+++ b/scss/_spinners.scss
@@ -3,7 +3,7 @@
 //

 .spinner-border {
@@ -15,7 +15,7 @@
   border-right-color: transparent;
   // stylelint-disable-next-line property-disallowed-list
   border-radius: 50%;
-  animation: $spinner-animation-speed linear infinite spinner-border;
+  animation: spinner-border $spinner-animation-speed linear infinite;
 }

 .spinner-border-sm {
@@ -47,7 +47,7 @@
   // stylelint-disable-next-line property-disallowed-list
   border-radius: 50%;
   opacity: 0;
-  animation: $spinner-animation-speed linear infinite spinner-grow;
+  animation: spinner-grow $spinner-animation-speed linear infinite;
 }

I think the name of the animation should be the first value.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:17 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
tcastellycommented, Apr 23, 2021

Thank you for your help, I confirm install css-loader fix the problem.

"resolutions": {
    "css-loader": "^5.2.4"
}

to your package.json and run yarn install again.

1reaction
alpadevcommented, Apr 23, 2021

This is not an issue of Bootstrap.

Using the name at the end corresponds to the spec. (This is true at least since 2017 - The 2013’s spec mentions the name at the beginning but also this issue: Need to also explain how order is important in terms of animation-name versus keywords, and probably also adjust the canonical order to match. The oldest version on github I found is from 2014 and already has the name at the end.)

The OP’s problem results from setting

css: {
    requireModuleExtension: false,
}

in the vue.config.js.

According to the vue-cli doc this does the following:

By default, only files that ends in *.module.[ext] are treated as CSS modules. Setting this to false will allow you to drop .module in the filenames and treat all *.(css|scss|sass|less|styl(us)?) files as CSS modules.

The line that breaks the compilation looks like this (after being transformed to CSS modules syntax):

.style_progress-bar-animated_gVpPS {
  -webkit-animation:1s linear infinite :local(progress-bar-stripes);
  animation:1s linear infinite :local(progress-bar-stripes)
}

The error message is misleading because it’s not cssnano having a problem with this code, but the postcss parser that is used by cssnano.

Not sure why moving the name around should solve this problem or how the OP found that solution.

The real cause for this problem seems to be css-loader (among other dependencies) being outdated in @vue/cli-service.

I setup a project with webpack (which is used by @vue/cli-service) and the latest versions of dependencies that are required to compile Bootstrap with css-modules support and it compiled without errors (even when minifying with cssnano).

@tcastelly either create a ticket at their repo or add

"resolutions": {
    "css-loader": "^5.2.4"
}

to your package.json and run yarn install again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

vue.js - It keeps saying I am missing a semi colon in my css ...
All things runs fine when I compile with npm dev. However when I did npm production it says I have a CSS missed...
Read more >
Asp.net MVC Verify if minification of CSS bundle is working ...
In this article we are discussing how to verify minification of CSS is working or not in Asp.Net MVC. Minification performs coding optimizations...
Read more >
CSS Minification Fails - Visual Studio Feedback
My CSS files fail to minify on server. Info gathered from internet ... (6,10): run-time error CSS1062: Expected semicolon or closing curly-brace, found...
Read more >
Webpack HookWebpackError: Missed semicolon - Support
Hi, I'm having an issue when deploying to Netlify although my project works locally. I'm getting the following error in the deploy log....
Read more >
Pretty Diff - The difference tool - UNPKG
Markup beautification will output flawed data if less than characters, "<", are included into sections of content and not escaped. This error occurs...
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