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: failed building service 'backend': failed invoking event handlers for 'prebuild', 'prebuild' hook failed with exit code: '2', Path: 'C:\Users\QWE0010\AppData\Local\Temp\azd-prebuild-4015135770.ps1'. : exit code: 2, stdout: #2371

Open
mohapatras opened this issue Feb 20, 2025 · 1 comment

Comments

@mohapatras
Copy link

mohapatras commented Feb 20, 2025

Initially connected to azure existing resources and ran `azd deploy. My configuration was successful.

Steps to Reproduce the issue

For development, manually installed chartjs library by running the below in cd app/frontend,

npm install chart.js react-chartjs-2

Then after making changes to the frontend and backend folder codes.

run azd deploy

Then the below error shows up,

Deploying service backend

(x) Failed: Deploying service backend

ERROR: failed building service 'backend': failed invoking event handlers for 'prebuild', 'prebuild' hook failed with exit code: '2', Path: 'C:\Users\QWE0010\AppData\Local\Temp\azd-prebuild-4015135770.ps1'. : exit code: 2, stdout:
up to date, audited 847 packages in 6s

45 vulnerabilities (40 moderate, 5 high)

To address issues that do not require attention, run:
npm audit fix

To address all issues (including breaking changes), run:
npm audit fix --force

Run npm audit for details.

[email protected] build
tsc && vite build

error TS2688: Cannot find type definition file for 'vite/client'.
The file is in the program because:
Entry point of type library 'vite/client' specified in compilerOptions
, stderr:

I have checked the 'vite/client'. It is available in its correct location. Please help on finding the root cause for this issue.

Update

Update: Tried the below steps referring to this link below. Still the issue persists.

Link: https://learn.microsoft.com/en-us/answers/questions/1289995/azd-up-azd-package-error

Remove-Item -Recurse -Force app/frontend/node_modules package-lock.json
npm cache clean --force
npm install
@pamelafox
Copy link
Collaborator

The error is: "Cannot find type definition file for 'vite/client'." which indicates something has gone wrong with your frontend configuration. Are you able to do a diff to see what you changed in the frontend folder, since the last time it was working? I would revert each change until it works.

You don't have to do the full azd deploy to get that error, I would guess that you can also get that error by going into the app/frontend folder and running npm install followed by npm run build

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

2 participants