admin管理员组文章数量:1122832
This is driving me crazy, I've tried so many different things but can't get round this issue.
I have a Nuxt app thats deployed to an Azure Web App (Not static web app) using Github Actions.
It deploys and works, until I add @sidebase/nuxt-auth
. At which point the deployment is successful according to Github Actions but I get a :( Application Error
on the Azure app.
I've tried increasing the memory as part of my workflow but it either a) has no effect or b) if I increase it to something super high I just get a timeout issue on Azure
env:
NODE_OPTIONS: "--max_old_space_size=4096"
It works fine locally npm run dev and npm run preview. I really don't know what to do now. Can anyone point me in a direction? I also did originally try a Static Web App and got the same issue, thats why I tried a Web App.
My nuxt config:
export default defineNuxtConfig({
devtools: { enabled: true },
modules: [
"@nuxtjs/tailwindcss",
"@storyblok/nuxt",
"@sidebase/nuxt-auth",
"@vueuse/nuxt",
"@nuxtjs/i18n",
],
storyblok: {
accessToken: process.env.STORYBLOK_ACCESS_TOKEN,
},
runtimeConfig: {
NUXT_SECRET: process.env.NUXT_SECRET,
AZURE_AD_CLIENT_ID: process.env.AZURE_AD_CLIENT_ID,
AZURE_AD_CLIENT_SECRET: process.env.AZURE_AD_CLIENT_SECRET,
AZURE_AD_TENANT_ID: process.env.AZURE_AD_TENANT_ID,
public: {}
},
auth: {
baseURL: process.env.BASE_URL,
},
i18n: {
vueI18n: './i18n.config.ts',
baseUrl: process.env.BASE_URL,
locales: [
{ code: 'en', language: 'en-GB', name: 'English' },
{ code: 'it', language: 'it-IT', name: 'Italiano' },
],
defaultLocale: 'en',
},
})
Nuxt Auth Handler:
import { NuxtAuthHandler } from '#auth'
import AzureADB2CProvider from "next-auth/providers/azure-ad-b2c";
const config = useRuntimeConfig();
export default NuxtAuthHandler({
secret: config.NUXT_SECRET,
providers: [
AzureADB2CProvider.default({
clientId: config.AZURE_AD_CLIENT_ID,
clientSecret: config.AZURE_AD_CLIENT_SECRET,
tenantId: config.AZURE_AD_TENANT_ID,
primaryUserFlow: 'B2C_1_susi',
authorization: { params: { scope: 'offline_access openid' } },
checks: ['pkce'],
client: {
token_endpoint_auth_method: 'none',
},
}),
],
})
Git workflow:
name: Azure Web App
on:
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Build Nuxt App
run: npm run build
env: # Add environment variables here
AZURE_AD_CLIENT_ID: ${{ secrets.AZURE_AD_CLIENT_ID }}
AZURE_AD_CLIENT_SECRET: ${{ secrets.AZURE_AD_CLIENT_SECRET }}
AZURE_AD_TENANT_ID: ${{ secrets.AZURE_AD_TENANT_ID }}
HOST: ${{ secrets.HOST }}
NUXT_SECRET: ${{ secrets.NUXT_SECRET }}
BASE_URL: ${{ secrets.BASE_URL }}
STORYBLOK_ACCESS_TOKEN: ${{ secrets.STORYBLOK_ACCESS_TOKEN }}
- name: 'Deploy to Azure Web App'
uses: azure/webapps-deploy@v3
with:
app-name: 'my-app'
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: '.output'
Azure error log:
2024-11-21T17:55:31.0312184Z <--- Last few GCs --->
2024-11-21T17:55:31.0312217Z
2024-11-21T17:55:31.0312259Z [76:0x56ca020] 36486 ms: Mark-Compact (reduce) 2047.5 (2062.9) -> 2047.3 (2062.9) MB, 133.15 / 0.03 ms (+ 19.4 ms in 1 steps since start of marking, biggest step 19.4 ms, walltime since start of marking 178 ms) (average mu = 0.461, current mu = 0.300)
2024-11-21T17:55:31.0312298Z
2024-11-21T17:55:31.0312322Z <--- JS stacktrace --->
2024-11-21T17:55:31.0312364Z
2024-11-21T17:55:31.0312395Z FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
2024-11-21T17:55:31.0312424Z ----- Native stack trace -----
2024-11-21T17:55:31.0312447Z
2024-11-21T17:55:31.0771650Z 1: 0xb80c98 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [node]
2024-11-21T17:55:31.0783802Z 2: 0xeede90 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
2024-11-21T17:55:31.0792338Z 3: 0xeee177 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
2024-11-21T17:55:31.0800252Z 4: 0x10ffd15 [node]
2024-11-21T17:55:31.0873988Z 5: 0x1117b98 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
2024-11-21T17:55:31.0882703Z 6: 0x10edcb1 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
2024-11-21T17:55:31.0889685Z 7: 0x10eee45 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
2024-11-21T17:55:31.0896798Z 8: 0x10cb566 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [node]
2024-11-21T17:55:31.0969725Z 9: 0x10bd194 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawWithImmortalMap(int, v8::internal::AllocationType, v8::internal::Map, v8::internal::AllocationAlignment) [node]
2024-11-21T17:55:31.0980255Z 10: 0x10bf976 v8::internal::FactoryBase<v8::internal::Factory>::NewRawOneByteString(int, v8::internal::AllocationType) [node]
2024-11-21T17:55:31.1007798Z 11: 0x10bfa2e v8::internal::FactoryBase<v8::internal::Factory>::NewStringFromOneByte(v8::base::Vector<unsigned char const> const&, v8::internal::AllocationType) [node]
2024-11-21T17:55:31.1016307Z 12: 0x15850c4 v8::internal::Uri::Encode(v8::internal::Isolate*, v8::internal::Handle<v8::internal::String>, bool) [node]
2024-11-21T17:55:31.1022987Z 13: 0xf76ecb v8::internal::Builtin_GlobalEncodeURI(int, unsigned long*, v8::internal::Isolate*) [node]
2024-11-21T17:55:31.1074606Z 14: 0x1961df6 [node]
本文标签: nuxtjsNuxt quotReached heap limit Allocation failedquot on Azure Web AppStack Overflow
版权声明:本文标题:nuxt.js - Nuxt "Reached heap limit Allocation failed" on Azure Web App - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736308169a1933566.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论