Azure / Azure/static-web-apps

API fails to build monorepo with yarn workspaces

Open
#542 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
No language data
Stars
346
Forks
67
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
After repackaging my multirepo project into a monorepo based on yarn workspaces, I noticed the app won't deploy to Azure Static Web Apps anymore. The issue is that when building the Functions app yarn does not pick up one of the dependencies is found in one of the yarn workspace packages. As a result it tries to find the package in the public registry and fails.

**To Reproduce**
See [this test repo](https://github.com/jeroenvdmeer/aswa-yarntest) I've created based on my setup.

**Expected behavior**
Similar to my development setup: after building the Functions app should be able to run.

**Screenshots**
More details can be found in [my test repo](https://github.com/jeroenvdmeer/aswa-yarntest).

![image](https://user-images.githubusercontent.com/1658477/128810101-459a4ef2-5460-4502-b148-1e030bd77ef9.png)

**Additional context**
One part I'm a bit concerned about is that I added a dummy yarn.lock file in the `packages/api` folder [to trigger Oryx to use yarn instead of npm](https://github.com/microsoft/Oryx/issues/1073). The lockfile didn't hinder me to build the Functions app locally, but if there are better ways to trigger Oryx to use yarn, I'm happy to give them a try to rule out this could affect the build process.

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.