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

RC21 Regression: "TypeError: crypto.getRandomValues is not a function" when deploying on GitHub pages #3090

Closed
4 tasks done
elringus opened this issue Oct 15, 2023 · 4 comments
Labels
bug: pending triage Maybe a bug, waiting for confirmation

Comments

@elringus
Copy link

Describe the bug

> vitepress build docs


  vitepress v1.0.0-rc.21

- building client + server bundles...
[vitepress] crypto.getRandomValues is not a function
file: /home/runner/work/naninovel.github.io/naninovel.github.io/docs/guide/integration-options.md
✖ building client + server bundles...
build error:
TypeError: crypto.getRandomValues is not a function
    at fillPool (file:///home/runner/work/naninovel.github.io/naninovel.github.io/node_modules/vitepress/dist/node/serve-M2jpHott.js:46428:12)
    at nanoid$1 (file:///home/runner/work/naninovel.github.io/naninovel.github.io/node_modules/vitepress/dist/node/serve-M2jpHott.js:46459:3)
    at Object.render (file:///home/runner/work/naninovel.github.io/naninovel.github.io/node_modules/vitepress/dist/node/serve-M2jpHott.js:46557:24)
    at Renderer$1.render (file:///home/runner/work/naninovel.github.io/naninovel.github.io/node_modules/vitepress/dist/node/serve-M2jpHott.js:35102:28)
    at Renderer$1.md.renderer.render (file:///home/runner/work/naninovel.github.io/naninovel.github.io/node_modules/vitepress/dist/node/serve-M2jpHott.js:29332:12)
    at MarkdownIt$1.render (file:///home/runner/work/naninovel.github.io/naninovel.github.io/node_modules/vitepress/dist/node/serve-M2jpHott.js:41569:24)
    at MarkdownIt$1.md.render (file:///home/runner/work/naninovel.github.io/naninovel.github.io/node_modules/vitepress/dist/node/serve-M2jpHott.js:29233:12)
    at MarkdownIt$1.md.render (file:///home/runner/work/naninovel.github.io/naninovel.github.io/node_modules/vitepress/dist/node/serve-M2jpHott.js:29286:22)
    at file:///home/runner/work/naninovel.github.io/naninovel.github.io/node_modules/vitepress/dist/node/serve-M2jpHott.js:47919:21
    at Object.transform (file:///home/runner/work/naninovel.github.io/naninovel.github.io/node_modules/vitepress/dist/node/serve-M2jpHott.js:48579:55)
Error: Process completed with exit code 1.

Reproduction

RC21: https://github.com/Naninovel/naninovel.github.io/actions/runs/6518735005/job/17709400139#step:5:13

Expected behavior

RC20: https://github.com/Naninovel/naninovel.github.io/actions/runs/6521208861/job/17709573364#step:5:14

System Info

-

Additional context

No response

Validations

@elringus elringus added the bug: pending triage Maybe a bug, waiting for confirmation label Oct 15, 2023
@elringus
Copy link
Author

elringus commented Oct 15, 2023

Looks like this is due to rc21 not working with node 16, which is still used by default when publishing to github pages. It's weird that they're still using 16 and I'm aware that it's possible to use a custom build script with a newer node, but not sure if a single call to random is worth breaking compatibility with the default gh pages workflow (especially in RC stream).

@simply-none
Copy link

I also encountered this error today, but not yesterday, perhaps because I re-ran npm install

@brc-dd
Copy link
Member

brc-dd commented Oct 15, 2023

Fixed in rc.22

But node 16 compatibility was dropped in rc.4 version (refer changelog), and we don't intend on maintaining vitepress for an EOL version of node.

which is still used by default when publishing to github pages

No it's not. actions/setup-node@v3 has no default value for node-version. You have probably specified node 16 in your workflow file or something like .nvmrc.

@brc-dd brc-dd closed this as completed Oct 15, 2023
@elringus
Copy link
Author

My bad, I'm stupid. Had github deploy workflow script with node 16 specified in it, but forgot about it and instead thought that gh pages has some default deploy flow. Sorry for the noise.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug: pending triage Maybe a bug, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

3 participants