Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { zip } from 'fflate';
import { zip } from 'fflate/browser';
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Importing from fflate/browser hard-codes the browser entry at module load time. Since IgxExcelExporterService is part of the public grids/core surface (and can be pulled into SSR/server bundles indirectly), this can cause SSR/runtime failures if fflate/browser touches browser globals during evaluation. Consider lazy-loading fflate/browser only when an export is triggered (similar to the dynamic import('jspdf') used in pdf-exporter.ts) or introducing an environment-aware wrapper that selects the appropriate entry for browser vs server builds.

Suggested change
import { zip } from 'fflate/browser';
import { zip } from 'fflate';

Copilot uses AI. Check for mistakes.

import { EventEmitter, Injectable } from '@angular/core';
import { ExcelElementsFactory } from './excel-elements-factory';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { IExcelFile } from './excel-interfaces';
import { ExcelStrings } from './excel-strings';
import { WorksheetData } from './worksheet-data';

import { strToU8 } from 'fflate';
import { strToU8 } from 'fflate/browser';
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same concern as in excel-exporter.ts: importing strToU8 from fflate/browser forces the browser build to be evaluated whenever this module is loaded. If this code ends up in an SSR/server bundle, and fflate/browser relies on browser-only globals at module init, it can break SSR even when Excel export isn’t used. If feasible, gate loading of the browser entry behind an on-demand (cached) dynamic import, or provide a wrapper that can resolve to a server-safe implementation when running under SSR.

Suggested change
import { strToU8 } from 'fflate/browser';
import { strToU8 } from 'fflate';

Copilot uses AI. Check for mistakes.
import { ExportHeaderType, ExportRecordType, IExportRecord, IColumnList, IColumnInfo, GRID_ROOT_SUMMARY, GRID_PARENT, GRID_LEVEL_COL } from '../exporter-common/base-export-service';
import { yieldingLoop } from '../exporter-common/yielding-loop';

Expand Down
Loading