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

Disable puppeteer sandbox to fix Vercel deployment #4936

Merged
merged 1 commit into from Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/.vitepress/config.ts
Expand Up @@ -129,7 +129,6 @@ export default defineConfig({
title: 'Rollup',
transformPageData,
vite: {
optimizeDeps: { include: ['moment-mini', '@braintree/sanitize-url'] },
plugins: [
renderMermaidGraphsPlugin(),
{
Expand Down
5 changes: 4 additions & 1 deletion docs/.vitepress/mermaid.ts
Expand Up @@ -14,6 +14,7 @@ const mermaidRegExp = /^```mermaid\n([\S\s]*?)\n```/gm;
const greaterThanRegExp = />/g;
const styleTagRegExp = /<style>[\S\s]*?<\/style>/gm;
const configFileURL = new URL('mermaid.config.json', import.meta.url);
const puppeteerConfigFileURL = new URL('puppeteer-config.json', import.meta.url);

export function renderMermaidGraphsPlugin(): Plugin {
const existingGraphFileNamesPromise = mkdir(graphsDirectory, { recursive: true })
Expand All @@ -28,7 +29,9 @@ export function renderMermaidGraphsPlugin(): Plugin {
const inFileURL = new URL(`${outFile}.mmd`, graphsDirectory);
await writeFile(inFileURL, codeBlock);
const { stdout, stderr } = await execPromise(
`npx mmdc --configFile ${fileURLToPath(configFileURL)} --input ${fileURLToPath(
`npx mmdc --configFile ${fileURLToPath(
configFileURL
)} --puppeteerConfigFile ${fileURLToPath(puppeteerConfigFileURL)} --input ${fileURLToPath(
inFileURL
)} --output ${fileURLToPath(outFileURL)}`
);
Expand Down
3 changes: 3 additions & 0 deletions docs/.vitepress/puppeteer-config.json
@@ -0,0 +1,3 @@
{
"args": ["--no-sandbox"]
}