Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MainNav.vue reads props before props is declared #162

Closed
ashleysommer opened this issue Jun 24, 2024 · 1 comment · Fixed by #164
Closed

MainNav.vue reads props before props is declared #162

ashleysommer opened this issue Jun 24, 2024 · 1 comment · Fixed by #164

Comments

@ashleysommer
Copy link
Contributor

Issue is here:
https://github.com/RDFLib/prez-ui/blame/067ab411c04ef9e58ea49b66b96a29ed430c4800/src/components/navs/MainNav.vue#L75

variable props isn't defined until line 83.

Running Prez-UI out of the box throws this error for me:

can't access lexical declaration 'props' before initialization

This bug has been in the codebase since 5th June 2023, not sure how how the code works fine for other users. Perhaps its a recent change in vue.js or a change in browser behavior that treats this as an unrecoverable error now, but was glossed over in the past.

@ashleysommer
Copy link
Contributor Author

ashleysommer commented Jun 26, 2024

Note, when re-testing this with Vue v3.3.4 (as locked in the package-lock.json lockfile) this bug cannot be reproduced.
However when installing the latest Vue as-per the version pattern in package.json (it installs v3.4.30) then it exposes this bug. Seems like the newer version is more susceptible to this use-before-declare JS bug, I can't tell which version of Vue changed this behaviour.

So options would be to change the package.json file to use ~3.3.0 instead of the current pattern ^3.3.0 so it will not use the new version of Vue, or simply fix the underlying JS variable ordering issue as per #164.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant