Closed rmanaem closed 11 months ago
good catch @rmanaem. It would be good to understand the difference. But more importantly we should remove the local non-static build scripts and make sure that we develop, test, and then run all in the same way that we deploy. So in other words: the fix for this is not so much to make npm run dev
succeed again, but rather to replace npm run dev
in development with npm run generate && npm run start
!
I did a little bit of digging, here is what I found:
null
or undefined
as an imaging modality and chain off of the modalities with no protectionnull
as an imaging modality: https://github.com/neurobagel/api/issues/232This breaks all statements of the form modalities[modality]
in this section:
https://github.com/neurobagel/query-tool/blob/b8df22b97c7680e67c39ea6533baa73133c174fd/components/ResultCard.vue#L71-L74
because modalities[modality]
will be undefined.
Although this will be fixed in the API, we will also have to protect here against a modality being null in the future, e.g. by using optional chaining, see "robustness principle".
I'll rename this issue and work on a safeguard.
Is there an existing issue for this?
Expected Behavior
The app should behave the same in both environments.
Current Behavior
When running the app in
dev
mode on themain
branch the app seems to break and respond with a rather ambiguous error once theSubmit Query
button is clicked. However, the app runs just fine when running in production and was built by runningnpm run generate
andnpm run start
Error message
Environment
No response
How to reproduce
npm run dev
on themain
branch, then run an empty query vsnpm run generate
andnpm run start
, then run an empty queryAnything else?
No response