Skip to content

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

@mohapatras

Description

@mohapatras

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    more info neededAn issue that needs more information from the reporter before it can be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions