microsoft / powerplatform-build-tools

Power Platform Build Tools automate common build and deployment tasks related to Power Platform. This includes synchronization of solution metadata (a.k.a. solutions) between development environments and source control, generating build artifacts, deploying to downstream environments, provisioning/de-provisioning of environments, and the ability to perform static analysis checks against your solution using the PowerApps checker service.
MIT License
198 stars 41 forks source link

Facing issue with custom file upload feature in MS Copilot Studio #1044

Open rishabhcopilot01 opened 1 month ago

rishabhcopilot01 commented 1 month ago

Describe the bug Trying to build functionality to allow users to upload files using copilot studio chatbot. Currently, facing issues while trying to launch webpart on localhost. Exact error shared below : -

AssertionError [ERR_ASSERTION]: Handler [handler-0 on GET /api/azurestorage/uploadsastoken] is missing a third argument (the "next" callback) but is not an async function. Middleware handlers can be either async/await or callback-based.Callback-based (non-async) handlers should accept three arguments: (req, res, next). Async handler functions should accept maximum of 2 arguments: (req, res).

We are referencing the below Github Component to build this functionality : - https://github.com/microsoft/CopilotStudioSamples/tree/master/BuildYourOwnCanvasSamples/2.location-and-file-uploading

Can you please assist with next steps. Happy to get on a call and discuss.

Expected behavior The file upload button should appear on copilot studio chatbot that helps in uploading file directly to azure blob storage.

Screenshots Capture

pete-willisSP commented 1 month ago

I have the same issue

AssertionError [ERR_ASSERTION]: Handler [handler-0 on GET /api/azurestorage/uploadsastoken] is missing a third argument (the "next" callback) but is not an async function. Middleware handlers can be either async/await or callback-based.Callback-based (non-async) handlers should accept three arguments: (req, res, next). Async handler functions should accept maximum of 2 arguments: (req, res).

NischalRam commented 3 weeks ago

if you are getting this error:

AssertionError [ERR_ASSERTION]: Handler [handler-0 on GET /api/azurestorage/uploadsastoken] is missing a third argument (the "next" callback) but is not an async function. Middleware handlers can be either async/await or callback-based.Callback-based (non-async) handlers should accept three arguments: (req, res, next). Async handler functions should accept maximum of 2 arguments: (req, res).

try to decrease the npm version

install nvm

run

nvm install v14.21.3

then run

npm start

to download nvm

https://www.freecodecamp.org/news/nvm-for-windows-how-to-download-and-install-node-version-manager-in-windows-10/ https://github.com/coreybutler/nvm-windows/releases

worked for me