-
Notifications
You must be signed in to change notification settings - Fork 511
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
Azure functions not working #2114
Comments
I have done a bit of investigation and this appears to be perhaps at least partially related to using pnpm or anything but npm. Reading the Azure Static Web Apps docs carefully it says this: Also notably it says in the Next.JS hybrid rendering docs the following: I'm going to take a small leap here and suggest that this note should also be on the nuxt docs. It appears that Microsoft's GitHub and Azure Pipelines does more than just build our applications it also appears to modify parts of it. I have two built outputs one from the SWA CLI from the GitHub task and one I built locally. They have some significant differences in various files e.g.: Ouputs: I'm not totally sure but I presume these are transforms added by the SWA CLI. Therefore if you are not using the SWA CLI to build your application you do not get these changes applied to the built output. At present Microsoft's Oryx builder does not support pnpm or other package managers and it doesn't look like support will be coming any time soon 😞 (see microsoft/Oryx#2340 microsoft/Oryx#1150 (comment)) I believe the Nitro docs should be updated to clarify that at present the Azure preset only works with npm as a package manager. It also makes it quite tricky to support any monorepos (my solution is a mono repo) as you have limited control over the build steps in the SWA cli. |
Thanks for all your investigations! Just to double check, have you tried the |
Yep this is set in the The outputs.zip file above are both built using npm as the package manager. The only difference is that SWA CLI built one of them. And the differences are shown in the screenshots. I probably shouldn't have said its related to pnpm because its not really. Its just that you must let the SWA CLI build your project. The reason this may be pertinent to pnpm users is that SWA CLI can only build projects that use npm as a package manager. |
The other thing to mention is that as it stands the docs for the average nuxt application will work. Except it does potentially cause issues as users may not realise that when it deploys the pacakage manager being used to build is This means their lock files aren't neccesarily respected so could cause some unexpected behaviour when deployed. It probably just needs a similar warning on the Azure preset to note that this only works with |
Okay, i think we are on a much better track. If you can confirm both presets work only with npm only, sure that would be more helpful to people I guess. Feel free to make PR 👍🏼 At the same time, this seems interesting. I am suspicious we might be doing something in nitro, external tracer that they don't like or support. Do you have a chance to try |
@GerryWilko Would you please use only Nitro (preferably) or Nuxt? Docus is not maintained and could be source of false positive results in our case. |
Have you tried adding this to your Build and Deploy action if you are using pnpm?
|
( |
Testing, Azure SWA works fine as documented on currently released nitro version but fails with nitro nightly release (h3 is irrelevant for this). (Still checking though.) |
Update: the underlying code works fine; the issue is that the code includes imports from |
Azure Functions is actually not working for most cases where azure libraries are used, as the zip packaging currently doesn't follow symlinks.
The zip bundle not containing the correct files will be fixed with #2769 |
See nitrojs/nitro-deploys#48 and #2092 for some context.
Unfrounatly i don't have any more information what exactly is the issue nor had a chance to investigate. So here is a placeholder.🤷♂️
(ref) all magic we have for azure support:
azure swa:
azure fns:
The text was updated successfully, but these errors were encountered: