-
Notifications
You must be signed in to change notification settings - Fork 32
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
Required files aren't automatically created (package.json, local.settings.json) #70
Comments
If I recall correctly, the Re: |
I tried testing it in a GitHub action with no "engines": {
"npm": ">=8.7.0 < 9",
"node": ">=16.14.0 < 17"
}, The version Oryx picked up is in that range, although I don't know for sure if it used that file to detect the version. Either way, it doesn't seem to have a problem until this adapter throws an error for the missing file. I might work on #69 so I can test a few things in an Azure deployment and maybe gain a better understanding of how the GitHub action works. Ultimately, I think it would be cleaner if However, I don't know how the GitHub action gets automatically generated and if there is a way to ensure it sets |
For the GitHub action, you just set the API location: https://github.com/geoffrich/svelte-adapter-azure-swa#azure-configuration I agree that moving It seems like the recently released Nuxt 3 integration does output the Azure function into an output directory, so maybe this is possible now?
We may be able to take inspiration from this code that controls the output. |
I'm also not sure what the implications of solving #42 would be, so I think it would be best if supporting that feature was in a separate PR to auto-generating the files. |
If Nuxt 3 is doing it, I've got hope that it's possible! I'm glad you found out about that. The code you referenced looks almost exactly like what I was going to do, except with a different path resolver and async write instead of sync write. The trick is going to be in making sure Microsoft's builder does what it needs to do before the adapter gets involved. I tested it in the branch I made for #69 and confirmed their builder defaults to node 14 if |
Okay, so it looks like this is definitely possible now! Started the work in #92 and it seems to work in the demo preview. Would appreciate some feedback on the approach if you have any. |
Currently, the adapter throws an error if
api/package.json
doesn't exist.Also, SWA reports errors if
local.settings.json
does not exist or does not have a validFUNCTIONS_WORKER_RUNTIME
value (see documentation). In order to suppress this error,api/local.settings.json
can be created with this content (see Azure/azure-functions-core-tools#2050 (comment)):This isn't mandatory, as it runs just fine without it, but the errors are annoying:
It would be easier on people who are new to this adapter if these files were automatically created when they are absent.
The text was updated successfully, but these errors were encountered: