mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-19 11:01:15 +00:00
fix(core): Inline config.js to index.html to prevent CF from caching it (#18945)
This commit is contained in:
@@ -2,6 +2,7 @@ import type { Plugin } from 'vue';
|
||||
import { AxiosError } from 'axios';
|
||||
import { ResponseError } from '@n8n/rest-api-client';
|
||||
import * as Sentry from '@sentry/vue';
|
||||
import { getAndParseConfigFromMetaTag } from '@n8n/stores/metaTagConfig';
|
||||
|
||||
const ignoredErrors = [
|
||||
{ instanceof: AxiosError },
|
||||
@@ -14,6 +15,13 @@ const ignoredErrors = [
|
||||
{ instanceof: Error, message: /ResizeObserver/ },
|
||||
] as const;
|
||||
|
||||
type SentryConfig = {
|
||||
dsn?: string;
|
||||
environment?: string;
|
||||
serverName?: string;
|
||||
release?: string;
|
||||
};
|
||||
|
||||
export function beforeSend(event: Sentry.ErrorEvent, { originalException }: Sentry.EventHint) {
|
||||
if (
|
||||
!originalException ||
|
||||
@@ -42,11 +50,12 @@ export function beforeSend(event: Sentry.ErrorEvent, { originalException }: Sent
|
||||
|
||||
export const SentryPlugin: Plugin = {
|
||||
install: (app) => {
|
||||
if (!window.sentry?.dsn) {
|
||||
const sentryConfig = getAndParseConfigFromMetaTag<SentryConfig>('sentry');
|
||||
if (!sentryConfig?.dsn) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { dsn, release, environment, serverName } = window.sentry;
|
||||
const { dsn, release, environment, serverName } = sentryConfig;
|
||||
|
||||
Sentry.init({
|
||||
app,
|
||||
|
||||
1
packages/frontend/editor-ui/src/shims.d.ts
vendored
1
packages/frontend/editor-ui/src/shims.d.ts
vendored
@@ -21,7 +21,6 @@ declare global {
|
||||
interface Window {
|
||||
BASE_PATH: string;
|
||||
REST_ENDPOINT: string;
|
||||
sentry?: { dsn?: string; environment: string; release: string; serverName?: string };
|
||||
n8nExternalHooks?: PartialDeep<ExternalHooks>;
|
||||
preventNodeViewBeforeUnload?: boolean;
|
||||
maxPinnedDataSize?: number;
|
||||
|
||||
Reference in New Issue
Block a user