Azure / static-web-apps

Azure Static Web Apps. For bugs and feature requests, please create an issue in this repo. For community discussions, latest updates, kindly refer to the Discussions Tab. To know what's new in Static Web Apps, visit https://aka.ms/swa/ThisMonth
https://aka.ms/swa
MIT License
322 stars 54 forks source link

Build failed #1509

Closed silwalprabin closed 1 month ago

silwalprabin commented 1 month ago

Describe the bug

I am using logging platform (BetterStack) on my SWA projects. I am seeing build failure asking secret for Logtail (We don't want logging of build but also tried building by adding LOGTAIL_SOURCE_TOKEN to github secrets)

Following is error I am receiving. [error] Logtail source token missing at new Logtail (node_modules/@logtail/core/dist/cjs/base.js:66:19) at new default_1 (node_modules/@logtail/core/dist/cjs/base.js:331:1) at new Node (node_modules/@logtail/node/dist/cjs/node.js:13:9) at .nuxt/prerender/chunks/runtime.mjs:916:13 at ModuleJob.run (node:internal/modules/esm/module_job:195:25) at async ModuleLoader.import (node:internal/modules/esm/loader:337:24) at async prerender (node_modules/nitropack/dist/chunks/prerender.mjs:57:44) at async node_modules/nuxt/dist/index.mjs:3471:7 at async build (node_modules/nuxt/dist/index.mjs:5001:5) at async Object.run (node_modules/nuxi/dist/chunks/build.mjs:95:5)

[error] Logtail source token missing

---End of Oryx build logs--- Oryx has failed to build the solution.

Expected behavior Build should be successful

silwalprabin commented 1 month ago

Fixed after custom check:

if (process.env. LOGTAIL_SOURCE_TOKEN) { logtail = new Logtail(process.env. LOGTAIL_SOURCE_TOKEN) }