Skip to content
Open
Changes from 3 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
28 changes: 28 additions & 0 deletions .github/workflows/webpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: NodeJS with Webpack

on:
push:
branches: [ "canary" ]
pull_request:
branches: [ "canary" ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Build
run: |
npm install
npx webpack
Comment on lines 30 to 33

Choose a reason for hiding this comment

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

P1 Badge Update CI job to use valid build step

The new workflow runs npm install followed by npx webpack, but this repository is configured for pnpm workspaces and does not include a root-level webpack entry/config. As written the job will consistently fail on every push/PR to canary because webpack cannot find a project to build (and npm will also ignore the existing pnpm lockfile), so the workflow never succeeds.

Useful? React with 👍 / 👎.

Copy link
Contributor

Choose a reason for hiding this comment

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

The direct npx webpack command may fail since it requires webpack to be installed and properly configured. Next.js projects typically use their own build system through commands like pnpm build, which would leverage the project's existing configuration. Consider replacing this with the appropriate Next.js build command to ensure compatibility with the project's build pipeline.

Suggested change
npx webpack
pnpm build

Spotted by Graphite Agent

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
npx webpack
pnpm run test-webpack

The workflow will fail because npx webpack is run without any configuration or entry point. Webpack won't know what to bundle and will error out.

View Details

Analysis

Webpack workflow fails with missing configuration and entry point

What fails: The GitHub Actions workflow in .github/workflows/webpack.yml executes npx webpack without any configuration file or entry point, causing the build to fail with "Module not found: Error: Can't resolve './src'"

How to reproduce:

# Clone the repo and run the workflow steps:
pnpm install
npx webpack

Result:

ERROR in main
Module not found: Error: Can't resolve './src' in '/path/to/repo'
  using description file: /path/to/repo/package.json (relative path: .)
    using description file: /path/to/repo/package.json (relative path: ./src)
      no extension
        /path/to/repo/src doesn't exist
      .js
        /path/to/repo/src.js doesn't exist
      .json
        /path/to/repo/src.json doesn't exist
      .wasm
        /path/to/repo/src.wasm doesn't exist
      as directory
        /path/to/repo/src doesn't exist

webpack 5.98.0 compiled with 1 error and 1 warning in 38 ms

Expected: The workflow should successfully test webpack functionality using the existing test suite, not fail with missing module resolution.

Fix: Changed the workflow to run pnpm run test-webpack which is the appropriate webpack test command already defined in package.json. This aligns with the workflow's purpose of validating webpack compatibility while using actual project test infrastructure rather than attempting to bundle a non-existent entry point.

Loading