Client does not run !? [SOLVED]

Hello,
I am in the process of migrating an application from 2.16 to 3.0rc (was .2, is now .4).
And, suddenly, yesterday, the client side has stopped working !
I mean that :

  • console in my Chromium browser stays empty
  • even just a console.log( 'here' ); in client/main.js doesn’t appear
  • while, server side, all common and server code run and logs just fine.
    I have rebooted
    I have tried to reverse one, then two days of commits without any change.
    I have ugraded from -rc.2 to -rc.4 without any change.
    A Firefox browser exhibits the same (lack of) behavior.

Another symptom is that modifying server or common code rightly restarts the server, while modifying client code has no effect at all (and in particular not “client refreshing” display).

All happens as if the client browsers do not reached the Meteor server, without nonetheless complaining that http://localhost:3003 would be not found.
And a netstat shows that the server is listening on the port, and browsers are connected.

When there is a syntax error somewhere, I see an error message or an exception.
Where I have accidentally created a reactivity loop, at least the brower was running (without end, but running).
But there, nothing happens at all. Even the “HMR connected” line doesn’t appear.

One more time:

  • common and server code run just fine
  • client doesn’t work, even if the client/main.js only contains a single console.log( ... );.

Not only I am stuck, but I don"t have any idea how to debug that ?

Does anyone would have any idea on how, on what, or on anything ?
Thanks (a lot) for your help !

Regards,
Pierre

1 Like

Had a new idea : as I make a significant use of business and applicative packages, I have all removed and re-added one per one.
Bingo : have identified one package which creates the issue.
To be done : identify the wrong commit + understand :wink:
See you later…

Identified the wrong commit:

$ git diff 6d668cfad6ebdb1858d5a04022485823ffb8ca9b 557511dc1c4095a70e8fcc4570bd02fcf7b2cead
diff --git a/src/client/stylesheets/validity.less b/src/client/stylesheets/validity.less
index 5c8e5a5..6d74b6d 100644
--- a/src/client/stylesheets/validity.less
+++ b/src/client/stylesheets/validity.less
@@ -28,6 +28,47 @@
         min-width: 0.5em;
     }
     margin: 0.5em 0;
+    fieldset {
+        border: 1px solid lightgray;
+        border-radius: 0.5em;
+        -moz-border-radius: 0.5em;
+        padding: 0.5em;
+    }
+    fieldset legend {
+        font-size: 1em;
+        float: inherit;
+        width: auto;
+        padding-left: 0.5em;
+        padding-right: 0.5em;
+    }
+    // align input field and the icon on the right
+    .input-svg-at-end {
+        display: flex;
+        align-items: center;
+    }
+    .input-svg-at-end input {
+        border-top-right-radius: 0;
+        border-bottom-right-radius: 0;
+        margin-right: 0;
+        border-right: 0;
+    }
+    .input-svg-at-end svg {
+        position: relative;
+        left: -0.75em;
+        border-top-left-radius: 0;
+        border-bottom-left-radius: 0;
+        border-top-right-radius: 0.375rem;
+        border-bottom-right-radius: 0.375rem;
+        padding: 0.7rem;
+        //background-color: @bgcolor;
+        border: 1px solid lightgray;
+        border-left: 0;
+        margin-left: 0;
+        &:hover {
+            background-color: darken( @bgcolor, 2.5% );
+            cursor: pointer;
+        }
+    }
 }
 
 .validity-panel {

To be continued…

OK. Got it !

The @bgcolor variable was not defined :frowning:
So, yes, this is wrong, and I should have thought to fix that when modularizing this code.
But:

  • I believe that, maybe, less could have warned somewhere about that
  • I didn’t imagine that such an error would lead to such behaviour. This is rather weird…
    And rather costly, too : a whole day to try almost everything, until having the good idea which led to the solution…

So… End of my adventures for today…

There’s possibly two things in Meteor 3 that caused this issue:

  1. How Meteor 3 handles errors from compiling stylesheets has a number of work arounds and temporary fixes. At one time there was an item on the plan for Meteor 3 to fix it, but it seems to have been removed. Normally less issues are gracefully handled, but I wouldn’t be surprised if there were some code paths that don’t work correctly.

  2. Meteor silently ignores errors during part of the build process, which can result in Meteor trying to run a broken app. I created a pull request a year ago to fix it, but it seems to be waiting on the stylesheet issue to be properly fixed first.