Skip to content

fix: replace require('fs') with ESM import in build e2e spec#3285

Merged
kamilmysliwiec merged 2 commits intov12.0.0from
copilot/sub-pr-3280-yet-again
Mar 11, 2026
Merged

fix: replace require('fs') with ESM import in build e2e spec#3285
kamilmysliwiec merged 2 commits intov12.0.0from
copilot/sub-pr-3280-yet-again

Conversation

Copy link

Copilot AI commented Mar 11, 2026

The cleanDist() helpers in build.command.e2e-spec.ts used require('fs') — unavailable in ESM modules — causing runtime failures since the test file runs under "type": "module".

Changes

  • test/e2e/build.command.e2e-spec.ts: Added top-level import * as fs from 'fs' and removed the inline require('fs') calls from both cleanDist() functions.
// Before
function cleanDist() {
  const fs = require('fs'); // ❌ not available in ESM
  fs.rmSync(path.join(appPath, 'dist'), { recursive: true, force: true });
}

// After
import * as fs from 'fs'; // ✅ top-level ESM import

function cleanDist() {
  fs.rmSync(path.join(appPath, 'dist'), { recursive: true, force: true });
}

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: kamilmysliwiec <23244943+kamilmysliwiec@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP address feedback from review on v12.0.0 major release PR fix: replace require('fs') with ESM import in build e2e spec Mar 11, 2026
@kamilmysliwiec kamilmysliwiec marked this pull request as ready for review March 11, 2026 15:00
@kamilmysliwiec kamilmysliwiec merged commit e9b35f8 into v12.0.0 Mar 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants