FHIR Chat · Sushi loader fail · shorthand

Stream: shorthand

Topic: Sushi loader fail


view this post on Zulip Brett Esler (Nov 25 2020 at 09:00):

https://chat.fhir.org/#narrow/stream/179252-IG-creation/topic/Sushi.20loader.20fail
Hi having some problems running latest version of fsh-sushi - cross posted original issue

view this post on Zulip Patrick Werner (Nov 25 2020 at 10:16):

We are also experiencing the same error (only on windows machines)

view this post on Zulip Jose Costa Teixeira (Nov 25 2020 at 10:22):

Did you update npm and node?

view this post on Zulip Patrick Werner (Nov 25 2020 at 10:27):

One colleague used node 14 and it failed, the other one uses node 10

view this post on Zulip Patrick Werner (Nov 25 2020 at 10:28):

The node 14 users reverted his win system to the last rescue point (with node10) and after that sushi worked.

view this post on Zulip Mark Scrimshire (Nov 25 2020 at 12:57):

This also impacts build.fhir.org.
It seems that antlr4 v4.9 was released on Nov 24 and it seems to require node 14.

Mark Scrimshire: I am getting an antlr4/error on my build.fhir.org build I was compiling locally with 0.16.0 but build.fhir.org is using fsh-sushi 1.0.1. I upgraded local copy to feh-sushi@1.0.1 and now I get the same issue in loader

Mark Scrimshire: Build.fhir.org gives following sushi/antlr4 error:
/usr/local/bin/sushi -> /usr/local/lib/node_modules/fsh-sushi/dist/app.js
npm WARN notsup Unsupported engine for antlr4@4.9.0: wanted: {"node":">=14"} (current: {"node":"12.16.1","npm":"6.13.4"})
npm WARN notsup Not compatible with your version of node/npm: antlr4@4.9.0

fsh-sushi@1.0.1
...

Sushi: npx: installed 111 in 4.976s (00:05.0058)
Sushi: Cannot find module 'antlr4/error' (00:05.0231)
Sushi: Require stack: (00:05.0231)

view this post on Zulip John Moehrke (Nov 25 2020 at 13:12):

I just joined the party

view this post on Zulip John Moehrke (Nov 25 2020 at 13:13):

sushi told me to update node and npm... so I did... now complete failure

view this post on Zulip Chris Moesel (Nov 25 2020 at 13:18):

Oh boy. OK. We're on it.

view this post on Zulip Chris Moesel (Nov 25 2020 at 13:21):

If it is ANTLR, then I'm disappointed that a minor release would introduce a breaking change like that. But they don't exactly use semantic versioning, so I guess I should not be surprised. I thought our package.lock file would protect us from unintentional upgrades like this, but perhaps not.

view this post on Zulip Chris Moesel (Nov 25 2020 at 13:50):

OK. So here's the skinny. We use a file called package-lock.json to lock our dependencies to specific versions. We thought this protected us from situations like this. It turns out, however, that package-lock.json is "not publishable" -- which means it only enforces dependencies in development, but does not enforce them for people installing the published version (which includes all of you).

To enforce dependencies for published versions of a Node.js library, you need to use npm-shrinkwrap.json instead. I've made that change locally and it seems to work as expected (keeping us on the intended version of the ANTLR dependency). We'll release an updated version of SUSHI with that change soon!

view this post on Zulip Mark Scrimshire (Nov 25 2020 at 14:03):

build.fhir.org also joined the party..... :(

view this post on Zulip Chris Moesel (Nov 25 2020 at 15:40):

FYI -- I've published SUSHI 1.0.2 with the fix for this. I rebuilt a few of the failing projects on the auto-build server and confirmed it fixed them. I haven't published the release notes yet, but you can grab it via the normal means: npm install -g fsh-sushi. To be clear, this release ensures antlr4 stays on v4.8.0 which does not require Node 14 (Node 10 and Node 12 should work fine).

view this post on Zulip Chris Moesel (Nov 25 2020 at 15:41):

I'm also in the middle of publishing a 0.16.1 for those of you who, for some reason, cannot make the jump to 1.x. I'll officially announce both of them in this stream once it's published.

view this post on Zulip David Pyke (Nov 25 2020 at 15:41):

Thank you!

view this post on Zulip Chris Moesel (Nov 25 2020 at 15:45):

You're welcome. @Brett Esler, @Patrick Werner, @Mark Scrimshire, @John Moehrke, @David Pyke -- please accept our apologies for this issue. It caught us by surprise too. We obviously try to avoid these types of show-stopping issues and we definitely learned something from this one. I'm sorry for any inconveniences it caused you and I thank you for helping us identify and resolve it.

view this post on Zulip Patrick Werner (Nov 25 2020 at 15:47):

no worries, thanks for your awesome work!

view this post on Zulip John Moehrke (Nov 25 2020 at 15:49):

it is all teamwork

view this post on Zulip John Moehrke (Nov 25 2020 at 15:51):

did you leave in debugging, or is this something else?

Sushi: info  Loaded package hl7.fhir.r4.core#4.0.1                               (00:04.0543)
Sushi: (node:13864) Warning: Accessing non-existent property 'INVALID_ALT_NUMBER' of module exports inside circular dependency (00:04.0691)
Sushi: (Use `node --trace-warnings ...` to show where the warning was created)   (00:04.0693)
Sushi: (node:13864) Warning: Accessing non-existent property 'INVALID_ALT_NUMBER' of module exports inside circular dependency (00:04.0695)
Sushi: info  Converting FSH to FHIR resources...                                 (00:04.0704)

view this post on Zulip Chris Moesel (Nov 25 2020 at 16:38):

Hi @John Moehrke -- no, we did not leave in debugging. This may be related to SUSHI now using the locked in versions and maybe one of them is behaving slightly differently than the previously unlocked-in version. What version of Node.js are you using? (hint: node -v).

view this post on Zulip Elliot Silver (Nov 25 2020 at 16:47):

I’ve been getting those errors since I started using sushi in the summer.

view this post on Zulip Chris Moesel (Nov 25 2020 at 17:17):

I looked into this some more. I'm guessing that anyone who is seeing this error is using Node 14. It seems to be related to the antlr4 dependency (it strikes again!). It's likely fixed in antlr4@4.9.0, but if we upgrade to that, then it forces everyone to switch to Node 14 -- which we don't want to do right now. So for now, I think you should probably just try your best to ignore it!

view this post on Zulip John Moehrke (Nov 25 2020 at 17:39):

okay. by your command.

view this post on Zulip Brett Esler (Nov 25 2020 at 20:30):

@Chris Moesel very much appreciated; nice to have my issues fixed while I was sleeping!

view this post on Zulip Grahame Grieve (Nov 25 2020 at 20:42):

what do I have to do to get this fix? I ran npm install -g fsh-sushi, and I'm now on fsh-sushi@1.0.2, but I get

Sushi: npx: installed 111 in 4.281s                                              (00:04.0588)
Sushi: Cannot find module 'antlr4/error'                                         (00:04.0781)

view this post on Zulip Grahame Grieve (Nov 25 2020 at 20:46):

the IG I'm trying to run has fsh.ini:

[FSH]
sushi-version=beta

view this post on Zulip Chris Moesel (Nov 25 2020 at 20:59):

That's the problem. They are still pointing at the old beta tag -- and we did not release a patch to the beta since the beta is over.

view this post on Zulip Chris Moesel (Nov 25 2020 at 20:59):

You know what -- I'll just move the beta tag to point to 1.0.2 -- since the beta is over and 1.0.x is what the beta was for anyway. Stand by.

view this post on Zulip Chris Moesel (Nov 25 2020 at 21:00):

OK, @Grahame Grieve -- go ahead and give it another shot.

view this post on Zulip Chris Moesel (Nov 25 2020 at 21:01):

(BTW -- if anyone has fsh.ini pointing to 0.16.0 they are going to run into the same issue -- but in that case we cannot just switch a tag. They'll have to change fsh.ini to point to 0.16.1.)

view this post on Zulip Grahame Grieve (Nov 26 2020 at 02:06):

yes fixed

view this post on Zulip John Moehrke (Dec 16 2020 at 22:22):

poke... I am still getting this set of messages. I have no fsh.ini as I have moved to the sushi-config.yaml.

view this post on Zulip Chris Moesel (Dec 16 2020 at 22:53):

@John Moehrke -- we thought this was fixed. Are you getting this locally or in the CI build? If locally, what version of SUSHI are you running? You can find out via sushi -v. You should be using version 1.0.2.

view this post on Zulip John Moehrke (Dec 17 2020 at 01:37):

local build

view this post on Zulip John Moehrke (Dec 17 2020 at 01:37):

I have fresh updated both IG build and sushi

view this post on Zulip John Moehrke (Dec 17 2020 at 01:38):


view this post on Zulip John Moehrke (Dec 17 2020 at 01:38):

Sushi: info  Running SUSHI v1.0.2 (implements FHIR Shorthand specification v1.0.0) (00:03.0321)

view this post on Zulip Chris Moesel (Dec 17 2020 at 13:33):

Oh! @John Moehrke -- I was thinking that you were saying that you get the error Grahame most recently reported in the thread (Cannot find module 'antlr4/error') -- which is definitely fixed. But I re-read the thread from the start and see that you are probably talking about Warning: Accessing non-existent property 'INVALID_ALT_NUMBER' of module exports inside circular dependency.

This error message only happens if you are running Node 14. People running Node 10 or 12 will not see it. The good news is that this error message is completely harmless and can be ignored. The bad news is that the only way for us to make it go away is make a change that would require everyone to use Node 14. We have a lot of users on Node 10 and Node 12 that such a change would affect -- so we're not ready to do that. As I said, you can safely ignore it, but if it really bothers you, then the best way to avoid it is to downgrade Node.js to Node 12.


Last updated: Apr 12 2022 at 19:14 UTC