Stream: javascript
Topic: Assistance Request Please: Error: No server url found.
Del D (Jun 02 2021 at 13:42):
Hi - I am new and learning more about FHIR and FHIR-Client.JS. I have read a lot and watched lectures, but no learning is better than practical application. So I am trying my first FHIR application:
Getting the following error with my launch.html code:
"Uncaught (in promise) Error: No server url found. It must be specified as iss or as fhirServiceUrl parameter"
Code is at FiddleJS:
https://jsfiddle.net/j8d7vhsb/1/
Both URLs are working. Looks like my syntax is appropriate - can someone point me to the issue why this error is occuring? Thanks
Gino Canessa (Jun 02 2021 at 14:21):
Hel Del, it looks like you are missing a few parameters that are required in the launch sequence. The documentation for SMART App Launch (specifically, parameters for standalone launch) lists what they are.
The error you are seeing is because you aren't passing in either an aud
or iss
parameter.
Hope this helps!
Del D (Jun 02 2021 at 14:36):
Thanks Gino. I am not using the Smart Library. I am using the FHIR-Client.JS library.
However, as I have learned the two most popular libraries for FHIR are apparetly Smart and FHIRKit, so now I am transitioning to them to learn more. I am going to abandon FHIR-CLient.JS and try Smart lib first.. thanks
Gino Canessa (Jun 02 2021 at 14:48):
No problem! The parameter is required to perform a SMART app launch (how the user authenticates and authorizes the application). It looks like the library you were using was specifically saying you needed the FHIR server URL to either appear as iss
or fhirServiceUrl
in the object you are passing to FHIR.oauth2.authorize
.
The documentation here is a little unclear, but it says under 'Common Options' that iss
is how you do a Standalone Launch (e.g., you are launching your app yourself, not from within the EHR). Under 'Advanced Options' it explains fhirServiceUrl
, and that it should only be used in development.
So, your fiddle needs to add a line iss: '{url of FHIR server}'
(I don't know the URL for the server you are trying to connect to), and it should work.
Last updated: Apr 12 2022 at 19:14 UTC