slackapi / deno-slack-sdk

SDK for building Run on Slack apps using Deno
https://api.slack.com/automation
MIT License
155 stars 27 forks source link

Windows Error "Could not resolve" when deploying - Local is fine #258

Closed diastowo29 closed 7 months ago

diastowo29 commented 8 months ago

I couldn't deploy my apps using Slack CLI command slack deploy here is the error i got

X [ERROR] Could not resolve "\My Folder\zd-slack\functions\my_custom_function.ts" [plugin deno-resolver] The plugin "deno-resolver" didn't set a resolve directory, so esbuild did not search for "\My Folder\zd-slack\functions\my_custom_function.ts" on the file system. Error bundling function file "my_custom_function" with esbuild error: Uncaught (in promise) Error: Build failed with 1 error: error: Could not resolve "\My Folder\zd-slack\functions\my_custom_function.ts" let error = new Error(text);

can anyone tell me about the error? cus its running smooth on local here is my slack doctor result

SYSTEM

✔ Operating System (virtual machine orchestrator)
    Version: windows (amd64)

✔ Deno (a JavaScript runtime)
    Version: v1.38.3
    Recommendation: We suggest using the latest version of Deno

✔ Git (a version control system)
    Version: git version 2.23.0.windows.1

SLACK

✔ CLI (this tool for building Slack apps)
    Version: 2.15.0

✔ Configurations (any adjustments to settings)
    System ID: e105e5d2-ace5-4970-8886-129771769c3d
    Last updated: 2023-12-15 17:15:18 +07:00
    Experiments: None

✔ Credentials (your Slack authentication)
    Team domain: trees-digital-labs
    Team ID: T0637915YTP29
    User ID: U0627QPQSP13K
    Last updated: 2023-12-15 09:38:47 +07:00
    Authorization level: Workspace
    Token status: Valid

PROJECT

✔ Configurations (your project's CLI settings)
    Project ID: 31410286-4965-481a-85d1-7cea53c7d72e

✔ Dependencies (requisites for development)
    deno_slack_hooks: 1.2.3
    deno_slack_sdk: 2.5.0
    deno_slack_api: 2.1.2

Errors: 0

filmaj commented 8 months ago

Hey @diastowo29 sorry for the late response!

Can you tell me which shell/terminal system you are using on Windows?

Any chance you could assemble a gist or a small repo to reproduce this in?

Random attempt: wondering if maybe we are not handling spaces in folder names well on Windows? Could you try removing the space in the My Folder folder and seeing if that helps?

mariiakyrych3nko commented 7 months ago

Hi! I have faced the same problem. When I run the bot locally everything works fine, but when I try to deploy it I get an error message: "⠧ Packaging app for deploymentX [ERROR] Could not resolve "\Users\mariia.kyrychenko\TeamCommunityBot\functions\creating_scheduled_trigger_labels.ts" [plugin deno-resolver] The plugin "deno-resolver" didn't set a resolve directory, so esbuild did not search for "\Users\mariia.kyrychenko\TeamCommunityBot\functions\creating_scheduled_trigger_labels.ts" on the file system. Error bundling function file "create_scheduled_trigger" with esbuild error: Uncaught (in promise) Error: Build failed with 1 error: error: Could not resolve "\Users\mariia.kyrychenko\TeamCommunityBot\functions\creating_scheduled_trigger_labels.ts" let error = new Error(text); error packaging project: Command for 'BuildProject' returned an error: exit status 1 (sdk_hook_invocation_failed)

"

Slack doctor output: SYSTEM

✔ Operating System (a user-computer interface)
    Version: windows (amd64)

✔ Deno (a JavaScript runtime)
    Version: v1.39.0
    Recommendation: We suggest using the latest version of Deno

✔ Git (a version control system)
    Version: git version 2.40.0.windows.1

SLACK

✔ CLI (this tool for building Slack apps)
    Version: 2.15.0

✔ Configurations (any adjustments to settings)
    System ID: 79a33b3e-59cd-4b21-9e35-1587f0af5c47
    Last updated: 2024-01-08 09:38:51 +01:00
    Experiments: None

✔ Credentials (your Slack authentication)
    Team domain: dynatrace-sandbox
    Team ID: E024T555MU0
    User ID: U05VAF92GQ6
    Last updated: 2024-01-08 09:38:40 +01:00
    Authorization level: Organization
    Token status: Valid

PROJECT

✔ Configurations (your project's CLI settings)
    Project ID: c0c78d1f-4759-4635-b3a0-c9b644b02916

✔ Dependencies (requisites for development)
    deno_slack_hooks: 1.2.3
    deno_slack_sdk: 2.5.0
    deno_slack_api: 2.1.2

Errors: 0

I work with webstorm's terminal.

filmaj commented 7 months ago

Let me see about getting a Windows VM set up somewhere to investigate this issue...

filmaj commented 7 months ago

I got a Windows VM setup via bootcamp!

I was not able to reproduce this issue with a few of our sample apps. Is there an app project that you could put up on github somewhere that would help me reproduce it?

BTW @mariiakyrych3nko WebStorm, as far as I can tell, will just use the default shell of your system. When you open up the Terminal tab in WebStorm for the first time, what does the terminal say? It is most likely either PowerShell or Command Prompt.

mariiakyrych3nko commented 7 months ago

Hi, a little follow up:) It's impossible for me to post my project on github because of authorization information, so I decided to deploy the application in a linux environment and I it worked) the problem on windows still persists

diastowo29 commented 7 months ago

hi @filmaj , sorry for the late response, i'm happy to share that this issue is resolved now. the problem is there is an errors on my 'my_custom_function.ts' file, the one that error log mentioned.. its not really an error, maybe its just a warning that somehow not poped out on local run.. in my case its just a 'const' or 'var' or 'let' usage for variable initialize.. @mariiakyrych3nko hope that helps you