LHNCBC / lforms

See the project website at http://lhncbc.github.io/lforms/, or view the demo website at https://lhcforms.nlm.nih.gov/lhcforms.
Other
107 stars 56 forks source link

Static images used by lforms cannot be found. #139

Open sudoris opened 1 year ago

sudoris commented 1 year ago

lforms version: 34.2.0

For the version specified above, lforms can't find the magnifying_glass.png and down_arrow_gray_10_10.png images which are used for search and dropdown inputs.

Screenshot 2023-11-12 at 9 57 23 PM
sudoris commented 1 year ago

Note: It does works when I download the images from https://clinicaltables.nlm.nih.gov/lforms-versions/34.2.0/webcomponent, and place them in my own public folder.

plynchnlm commented 1 year ago

Can you provide steps to reproduce the problem?

rob-a-bolton commented 9 months ago

Having the same issue here.
I'm loading with webpack rather than using directly as a client html link tag, and webpack fails to bundle due to missing the images.
Following the steps in the README you'll have included all the css/js but not the images. Perhaps this needs adding to the README?

plynchnlm commented 9 months ago

As noted in the README, you should not attempt to webpack to re-bundle lforms. This is because it is already bundled with webpack because it is released as a web component. Instead, you should include the files with script/link tags (a point which we should probably make more clear in the README).

sudoris commented 9 months ago

Haven't had time to write out the exact steps to reproduce the issue, but I'm including the files directly with script/link tags.

Edit: Sorry, I lied. I forgot that I was actually including the files using a custom script (https://github.com/sudoris/lhc_forms_client/blob/main/src/loadExternalScript.ts). So I am using a bundler (vite) for my application, but loading the files for lform separately at run time.

plynchnlm commented 9 months ago

Interesting. We also have created (but not advertised) an lforms-loader package which can be used to load the LForms files at runtime. It is available on npm. Several of our own websites are using it successfully.

sudoris commented 9 months ago

Interesting. We also have created (but not advertised) an lforms-loader package which can be used to load the LForms files at runtime. It is available on npm. Several of our own websites are using it successfully.

That's awesome. I'll have to check that out.