Skip to content

Conversation

@Tobbe
Copy link
Member

@Tobbe Tobbe commented Jan 6, 2026

I was getting this error in another PR (#938)

Run ./tasks/test-project/convert-to-ssr-fixture /home/runner/work/cedar/test-project
node:internal/modules/cjs/loader:1424
  throw err;
  ^

Error: Cannot find module './tasks'
Require stack:
- /home/runner/work/cedar/cedar/tasks/test-project/convert-to-ssr-fixture
    at Module._resolveFilename (node:internal/modules/cjs/loader:1421:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1059:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1064:22)
    at Module._load (node:internal/modules/cjs/loader:1227:37)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:245:24)
    at Module.require (node:internal/modules/cjs/loader:1504:12)
    at require (node:internal/modules/helpers:152:16)
    at Object.<anonymous> (/home/runner/work/cedar/cedar/tasks/test-project/convert-to-ssr-fixture:8:28)
    at Module._compile (node:internal/modules/cjs/loader:1761:14) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/runner/work/cedar/cedar/tasks/test-project/convert-to-ssr-fixture'
  ]
}

The reason being that ./tasks was renamed to ./tasks.mts earlier (see #934), and this import was missed in that PR, partly because the convert-to-ssr-fixture file was extensionless, so I didn't immediately spot it as a JS/TS file that might need attention, and partly because this workflow is only executed on PRs that our "code change detection" script identifies as SSR-related code. And the original PR that renamed tasks.mts didn't trigger the SSR change detection

@netlify
Copy link

netlify bot commented Jan 6, 2026

Deploy Preview for cedarjs canceled.

Name Link
🔨 Latest commit 98689ce
🔍 Latest deploy log https://app.netlify.com/projects/cedarjs/deploys/695ce6689340cd0008b7a102

@github-actions github-actions bot added this to the chore milestone Jan 6, 2026
@nx-cloud
Copy link

nx-cloud bot commented Jan 6, 2026

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 98689ce

Command Status Duration Result
nx run-many -t build:pack --exclude create-ceda... ✅ Succeeded 6s View ↗
nx run-many -t build ✅ Succeeded 6s View ↗
nx run-many -t test --minWorkers=1 --maxWorkers=4 ✅ Succeeded 6s View ↗
nx run-many -t test:types ✅ Succeeded 9s View ↗

☁️ Nx Cloud last updated this comment at 2026-01-06 11:00:59 UTC

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 6, 2026

Greptile Summary

Migrated convert-to-ssr-fixture from a shell script to an ESM TypeScript module (.mts).

Key changes:

  • Removed shebang and converted CommonJS require statements to ESM import statements
  • Changed require('node:path') to import path from 'node:path'
  • Updated imports for yargs/helpers and yargs/yargs to ESM syntax
  • Changed ./tasks import to ./tasks.mts to match the renamed file
  • Cleaned up formatting and comments for consistency
  • Updated GitHub workflow to execute the file using node ./tasks/test-project/convert-to-ssr-fixture.mts

This change aligns with the ongoing ESM migration effort in the repository and follows the pattern established in recent commits (e.g., #934). The workflow executes the TypeScript file using Node.js 24, which has experimental TypeScript support.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are straightforward: a direct migration from CommonJS to ESM with no logic changes. The conversion follows established patterns in the codebase (similar migrations in chore(test-project): Migrate tasks.js and util.js to ESM/TS #934), uses standard ESM import syntax, and properly updates the workflow execution command. The code maintains the same functionality while adhering to the repository's ESM migration strategy.
  • No files require special attention

Important Files Changed

Filename Overview
tasks/test-project/convert-to-ssr-fixture.mts Migrated from shell script to ESM TypeScript module with proper imports and formatting
.github/workflows/ssr-smoke-tests.yml Updated workflow command to execute the renamed .mts file using Node.js

Sequence Diagram

sequenceDiagram
    participant GHA as GitHub Actions Workflow
    participant Node as Node.js 24
    participant Script as convert-to-ssr-fixture.mts
    participant Tasks as tasks.mts
    participant Yargs as yargs library
    participant FS as File System

    GHA->>Node: Execute: node convert-to-ssr-fixture.mts <project-path>
    Node->>Script: Load ESM module
    Script->>Yargs: Parse CLI arguments using yargs
    Yargs-->>Script: Return parsed args (project path)
    Script->>Tasks: Import streamingTasks function
    Script->>Script: Resolve OUTPUT_PROJECT_PATH
    Script->>Tasks: Call streamingTasks(path, {verbose: true})
    Tasks-->>Script: Return configured task runner
    Script->>Tasks: Execute tasks.run()
    Tasks->>FS: Apply SSR configuration to test project
    FS-->>Tasks: Files modified
    Tasks-->>Script: Tasks completed
    Script->>GHA: Exit with status code
Loading

@Tobbe Tobbe merged commit 9922435 into main Jan 6, 2026
42 checks passed
@Tobbe Tobbe deleted the tobbe-chore-ssr-smok-tests-mts branch January 6, 2026 11:20
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