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

At the end of the push process: ENOENT no such file or directory, stat #13647

Closed
2 tasks done
SebSchwartz opened this issue Mar 13, 2024 · 5 comments
Closed
2 tasks done
Labels
functions Issues tied to the functions category pending-response Issue is pending response from the issue author pending-triage Issue is pending triage

Comments

@SebSchwartz
Copy link

How did you install the Amplify CLI?

pnpm -g

If applicable, what version of Node.js are you using?

v18.19.0

Amplify CLI Version

12.10.1

What operating system are you using?

mac

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No manual changes made

Describe the bug

I use PNPM. Just switched from cli v10.7.3 to v12.10.1.

I push my change, everything is push and updated then at the end, just before the post-push hooks, I always got this error:
🛑 ENOENT: no such file or directory, stat '/Users/myUser/Documents/Dev/myProject/packages/frontend/amplify/backend/function/myFonction/src/node_modules/@types/aws-lambda'

The function got the @types/aws-lambda installed as devDependencies.

The problem is that the cli wants to update everything again on the next push as I suppose it didn't save it was done.

I already tried to change the amplify.state of the function with:

"scripts": {
    "build": "pnpm i"
  }

Expected behavior

No error message and no redeploy everything each time.

Reproduction steps

  1. amplify push --y

Project Identifier

3d4f4c99-5447-4f34-9050-9d0fe8e50c74

Log output

# Put your logs below this line


Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@SebSchwartz SebSchwartz added the pending-triage Issue is pending triage label Mar 13, 2024
@ykethan
Copy link
Member

ykethan commented Mar 14, 2024

Hey @SebSchwartz, thank you for reaching. Could you try changing directory into amplify/backend/function/<function-name>/, remove the node_modules and running pnpm i, then at the root of the project run amplify push does this throw a similar error message?

@ykethan ykethan added functions Issues tied to the functions category pending-response Issue is pending response from the issue author labels Mar 14, 2024
@SebSchwartz
Copy link
Author

Hi @ykethan ,
Already tried to remove all node_modules with 'npx npkill' package then pnpm i at the root folder.
Maybe what's missing in my explanation is that i'm in a pnpm workspace. Here is the workspace configuration:

packages:
  # include packages in subfolders (e.g. apps/ and packages/)
  - 'apps/*'
  - 'packages/*'
  - 'tools/*'
  - 'packages/webapp/amplify/backend/*'
  - 'packages/webapp/amplify/backend/custom/*'
  - 'packages/webapp/amplify/backend/function/*/src'
  - 'packages/webapp/amplify/backend/function/layer1/lib/nodejs'
  - 'packages/webapp/amplify/backend/function/layer2/lib/nodejs'

So the steps described (removing all modules then retry) doesn't work :(

@github-actions github-actions bot removed the pending-response Issue is pending response from the issue author label Mar 14, 2024
@ykethan
Copy link
Member

ykethan commented Mar 15, 2024

Hey @SebSchwartz, thank you for the information. Amplify CLI unfortunately does not handle symlinks well when it downloads and unzips your backend state (e.g. on amplify pull), which is a popular approach for linking dependencies between workspaces. In the case of pnpm it will load dependencies into its store at the workspace root, and symlink to each workspace package in their relative node_modules directory. While this error seems odd because this is a types package in question, can you try removing the workspace paths from your pnpm-workspace.yaml file?

@ykethan ykethan added the pending-response Issue is pending response from the issue author label Mar 15, 2024
@ykethan
Copy link
Member

ykethan commented May 3, 2024

Closing the issue due to inactivity. Do reach out to us if you require any assistance.

@ykethan ykethan closed this as not planned Won't fix, can't repro, duplicate, stale May 3, 2024
Copy link

github-actions bot commented May 3, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
functions Issues tied to the functions category pending-response Issue is pending response from the issue author pending-triage Issue is pending triage
Projects
None yet
Development

No branches or pull requests

2 participants