Azure / Azure/static-web-apps

Importing the @mux/mux-node package destroys all SWA functions in /api

Open
#1,448 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

I'm using a function in my SWA to verify signed [Mux](https://www.mux.com/for/node) hosted videos.

However, when I deploy, it seems to destroy itself and all other functions in the /api. It works great locally with the SWA CLI, it builds without complaint in GitHub actions.

With it installed, it removes the every function from the /api folder with the message 'No Functions have been pushed to this Static Web App.'

**To Reproduce**
Steps to reproduce the behavior:
1. `npm install @mux/mux-node`
2. Add `import Mux from '@mux/mux-node'` to your function
3. Pain

```js
import { app } from "@azure/functions"
import Mux from '@mux/mux-node' // <- problem

app.http('test-function', {
methods: ['GET'],
authLevel: 'anonymous',
handler: async () => {

return { jsonBody: { test: "name" } }
}
})

```

**Test repo**
https://github.com/blackspike/vue-vite-swa-fns

**With `import Mux from '@mux/mux-node'`**
![2024-04-02 at 15 44](https://github.com/Azure/static-web-apps/assets/4052525/ebe0b1b3-8553-4806-b067-733094bbaede)

**Without `import Mux from '@mux/mux-node'`**

![2024-04-02 at 15 50](https://github.com/Azure/static-web-apps/assets/4052525/7830e116-5152-4aea-9956-0d727c97fd0e)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.