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

[BUG] Unable to use Google APIs in a deno slack app #375

Open
mversluys opened this issue Nov 8, 2024 · 2 comments
Open

[BUG] Unable to use Google APIs in a deno slack app #375

mversluys opened this issue Nov 8, 2024 · 2 comments
Labels
question Further information is requested

Comments

@mversluys
Copy link

The deno-slack versions

    "deno-slack-sdk/": "https://deno.land/x/[email protected]/",
    "deno-slack-api/": "https://deno.land/x/[email protected]/",

Deno runtime version

deno 2.0.2 (stable, release, aarch64-apple-darwin)
v8 12.9.202.13-rusty
typescript 5.6.2

OS info

ProductName:		macOS
ProductVersion:		15.1
BuildVersion:		24B83
Darwin Kernel Version 24.1.0: Thu Oct 10 21:02:26 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T8122

Describe the bug

Unable to make use of Google deno packages.

I'm attempting to import the Google sheets API using

import { Sheets, auth as GoogleAuth } from 'https://googleapis.deno.dev/v1/sheets:v4.ts';

This was working earlier in the year and I have a deployed application that utilizes this, but now when I use slack run I get the following error

error: Uncaught (in promise) TypeError: Requires import access to "googleapis.deno.dev:443", run again with the --allow-import flag

I've searched high and low and tried add --allow-import to get-hooks in slack.json but haven't be able to find a way to convince deno to allow the import of the google APIs. I reached out to Slack support and they directed me here.

Steps to reproduce

  1. Clone the deno starter template https://github.com/slack-samples/deno-starter-template
  2. In functions/sample_function.ts, add
import { Sheets, auth as GoogleAuth } from 'https://googleapis.deno.dev/v1/sheets:v4.ts';
  1. Run the project using slack run

Expected result

Expect that I'm able to import google deno packages.

Actual result

It fails with the following error

error: Uncaught (in promise) TypeError: Requires import access to "googleapis.deno.dev:443", run again with the --allow-import flag

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

@filmaj filmaj added the question Further information is requested label Nov 12, 2024
@filmaj
Copy link
Contributor

filmaj commented Nov 12, 2024

Try adding googleapis.deno.dev to the outgoingDomains array of your app manifest.

https://api.slack.com/automation/manifest

@jphchan
Copy link

jphchan commented Nov 22, 2024

I get the same thing when attempting to follow the slack announcement bot tutorial. Running step 6 where you create the trigger it fails with the same message. I. My case it fails trying to reach cdn.skypack.dev. I checked and the demo apps manifest includes the outgoing domains section and lists the location so I don’t think that’s it.

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

No branches or pull requests

3 participants