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

Fix #133 (Docs is not building with node 16) #158

Merged
merged 1 commit into from
Dec 14, 2021

Conversation

nhuet
Copy link
Contributor

@nhuet nhuet commented Dec 13, 2021

Call the function updateLinks() which references document (ie DOM)
inside a mounted hook.

Indeed the previous code was working with yarn vuepress dev docs but
not with yarn vuepress build docs because when building, vue uses a
server to generate the static website and usually document is only
available on client side.

However this is possible when inside the mounted hook
(https://vuepress.vuejs.org/guide/using-vue.html#browser-api-access-restrictions)

NB: no idea why this was working with node 14 though...

@nhuet
Copy link
Contributor Author

nhuet commented Dec 13, 2021

Fix #133

Call the function updateLinks() which references document (ie DOM)
inside a `mounted` hook.

Indeed the previous code was working with `yarn vuepress dev docs` but
not with `yarn vuepress build docs` because when *building*, vue uses a
server to generate the static website and usually `document` is only
available on client side.

However this is possible when inside the mounted hook
(https://vuepress.vuejs.org/guide/using-vue.html#browser-api-access-restrictions)

NB: no idea why this was working with node 14 though...
@nhuet nhuet marked this pull request as ready for review December 13, 2021 17:21
@galleon galleon merged commit 3e95802 into airbus:master Dec 14, 2021
@nhuet nhuet deleted the nh/fix_doc_with_node16 branch December 14, 2021 09:05
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 this pull request may close these issues.

3 participants