Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"ERROR in × Module not found: Can't resolve" #28951

Open
1 of 4 tasks
Niewdanka opened this issue Nov 15, 2024 · 0 comments
Open
1 of 4 tasks

"ERROR in × Module not found: Can't resolve" #28951

Niewdanka opened this issue Nov 15, 2024 · 0 comments

Comments

@Niewdanka
Copy link

Niewdanka commented Nov 15, 2024

Current Behavior

Hi! After upgrading Nx from version 20.0.12 to 20.1.0, I am getting the following error:
"ERROR in × Module not found: Can't resolve '/app/apps/test/src/main.ts' in '/app/apps/test'"

This happens when I try to build a Docker image and use nx build inside the Dockerfile. In previous versions of Nx, I didn’t encounter this error.
When I build the project using the CLI, everything works as expected.

Expected Behavior

I should be able to build docker image.

GitHub Repo

No response

Steps to Reproduce

  1. Craete Dockerfile
WORKDIR /app

COPY package.json pnpm-lock.yaml ./

RUN pnpm install --frozen-lockfile

COPY . .

RUN pnpx nx build test
  1. Build docker image

Nx Report

Node           : 22.4.0
OS             : darwin-arm64
Native Target  : aarch64-macos
pnpm           : 9.13.0

nx (global)        : 20.0.0
nx                 : 20.1.1
@nx/js             : 20.1.1
@nx/jest           : 20.1.1
@nx/eslint         : 20.1.1
@nx/workspace      : 20.1.1
@nx/eslint-plugin  : 20.1.1
@nx/nest           : 20.1.1
@nx/node           : 20.1.1
@nx/rspack         : 20.1.1
@nx/web            : 20.1.1
typescript         : 5.6.3
---------------------------------------
Registered Plugins:
@nx/eslint/plugin
@nx/jest/plugin

Failure Logs

ERROR in × Module not found: Can't resolve '/app/apps/test/src/main.ts' in '/app/apps/test

Package Manager Version

pnpm 9.13.0

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant