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

getting PermissionDenied: 'Deno.makeTempDir' is not allowed in this context #69

Open
fcavalcantirj opened this issue Nov 30, 2022 · 8 comments

Comments

@fcavalcantirj
Copy link

Locally it works fine, running with allow-write on deno run.

when I run on deno, on the logs I get;

PermissionDenied: 'Deno.makeTempDir' is not allowed in this context. at Object.makeTempDir (deno:deploy/js/02_fs.js:193:9) at ChromeLauncher.launch (https://deno.land/x/[email protected]/src/deno/Launcher.ts:31:49) at PuppeteerDeno.launch (https://deno.land/x/[email protected]/src/deno/Puppeteer.ts:115:31) at crawl (file:///src/index.js:136:35)

not sure it's a newbie question but how can I run allow-write on deno?

@tomvorel13
Copy link

Same problem here. Did you get it resolved @fcavalcantirj ?

@dalezak
Copy link

dalezak commented Mar 20, 2023

Having the same issue running deno-puppeteer in a Supabase edge function.

@pencilcheck
Copy link

getting this error as well on deno deploy

@MrTanoshii
Copy link

Having the same issue because Supabase restricts the file system
See: supabase/edge-runtime#120

The code snippet below is attempting to make a profile for the browser, maybe the solution would be to keep the profile in memory only?

const profilePath = pathJoin(
await Deno.makeTempDir(),
"puppeteer_dev_chrome_profile-",
);

@tatwater
Copy link

Adding my +1 to the problem others here have encountered with the Supabase edge function file system restriction.

I'm trying to preserve my Browserless.io usage for production by running puppeteer locally in development, but I'm hitting this same error when it tries to make a Chromium instance:

[Error] TypeError: Deno.makeTempDir is not a function
    at ChromeLauncher.launch (https://deno.land/x/[email protected]/src/deno/Launcher.ts:31:45)
    at PuppeteerDeno.launch (https://deno.land/x/[email protected]/src/deno/Puppeteer.ts:115:27)

Would be really nice to have an option to keep this in an in-memory buffer while I build out my app!

@Luchooo
Copy link

Luchooo commented Jan 9, 2024

Same problem here. Did you get it resolved @tomvorel13 ?

@Luchooo
Copy link

Luchooo commented Jan 15, 2024

I'm not sure if this information is useful to you, but from what I understand about Deno deploy, its environment is read-only. Therefore, in the case of using Deno.makeTempDir, Deno's environment requires --allow-write. However, we cannot grant permissions to Deno deploy at the moment. The same issue arises when using page.screenshot(...), as this action also requires --allow-write. If I am mistaken, please let me know. 😀

@BruceSuperProgramer
Copy link

BruceSuperProgramer commented Feb 21, 2024

There's an example in the Supabase repository that utilizes Browserless. I'm currently experimenting with it to evaluate its effectiveness. However, a potential drawback of this approach is the associated cost.

https://github.com/supabase/supabase/pull/10615/files

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

No branches or pull requests

8 participants