-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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 packaging service 'backend': failed invoking event handlers for 'prepackage', 'prepackage' hook failed with exit code: '2', Path: 'Temp\azd-prepackage-3470486931.ps1'. : exit code: 2 #671
Comments
Create a new folder and switch to it in the terminal |
Try this once. |
I have taken the latest update of the code.And getting the above error. |
Are there any additional logs you can provide? I'd like to see what error caused the hook to fail. |
| ==| Packaging service backendsrc/authConfig.ts:3:64 - error TS2307: Cannot find module '@azure/msal-browser' or its corresponding type declarations. 3 import { AuthenticationResult, IPublicClientApplication } from "@azure/msal-browser"; src/authConfig.ts:77:13 - error TS7006: Parameter 'error' implicitly has an 'any' type. 77 .catch((error) => { src/components/LoginButton/LoginButton.tsx:22:19 - error TS7006: Parameter 'error' implicitly has an 'any' type. 22 .catch((error) => console.log(error)); src/components/LoginButton/LoginButton.tsx:30:17 - error TS7006: Parameter 'error' implicitly has an 'any' type. 30 .catch((error) => console.log(error)); src/index.tsx:6:65 - error TS2307: Cannot find module '@azure/msal-browser' or its corresponding type declarations. 6 import { PublicClientApplication, EventType, AccountInfo } from '@azure/msal-browser'; src/index.tsx:25:36 - error TS7006: Parameter 'event' implicitly has an 'any' type. 25 msalInstance.addEventCallback((event) => { Found 6 errors in 3 files. Errors Files npm ERR! A complete log of this run can be found in: ERROR: failed packaging service 'backend': failed invoking event handlers for 'prepackage', 'prepackage' hook failed with exit code: '2', Path: 'C:\Users\ChoubeTK\AppData\Local\Temp\azd-prepackage-4273095110.ps1'. : exit code: 2 |
@mattmsft Could you look into why the package isn't found? |
I have the same error when running azd up. Here's my log: Try 12 } from '@fluentui/react-table'; src/components/TokenClaimsDisplay/TokenClaimsDisplay.tsx:46:25 - error TS7006: Parameter 'item' implicitly has an 'any' type. 46 renderCell: item => { src/components/TokenClaimsDisplay/TokenClaimsDisplay.tsx:58:25 - error TS7006: Parameter 'item' implicitly has an 'any' type. 58 renderCell: item => { src/components/TokenClaimsDisplay/TokenClaimsDisplay.tsx:71:27 - error TS7006: Parameter 'item' implicitly has an 'any' type. 71 getRowId={item => item.name} src/components/TokenClaimsDisplay/TokenClaimsDisplay.tsx:75:25 - error TS7031: Binding element 'renderHeaderCell' implicitly has an 'any' type. 75 {({ renderHeaderCell }) => {renderHeaderCell()}} src/components/TokenClaimsDisplay/TokenClaimsDisplay.tsx:79:21 - error TS7031: Binding element 'item' implicitly has an 'any' type. 79 {({ item, rowId }) => ( src/components/TokenClaimsDisplay/TokenClaimsDisplay.tsx:79:27 - error TS7031: Binding element 'rowId' implicitly has an 'any' type. 79 {({ item, rowId }) => ( src/components/TokenClaimsDisplay/TokenClaimsDisplay.tsx:81:25 - error TS7031: Binding element 'renderCell' implicitly has an 'any' type. 81 {({ renderCell }) => {renderCell(item)}} Found 8 errors in the same file, starting at: src/components/TokenClaimsDisplay/TokenClaimsDisplay.tsx:12 (x) Failed: Packaging service backend ERROR: failed packaging service 'backend': failed invoking event handlers for 'prepackage', 'prepackage' hook failed with exit code: '2', Path: 'C:\Users\XXXX\XXX\Local\Temp\azd-prepackage-2967539339.ps1'. : exit code: 2 |
@crampaldo What node version are you running? Wondering if thats causing the issue (as I haven't managed to replicate). |
I have version 18.18.0 |
Interesting, I can't get it to show those errors. However, I've added types, please try changes in https://github.com/Azure-Samples/azure-search-openai-demo/pull/695/files |
Thank you Pamela, I tried but still getting this error: src/components/TokenClaimsDisplay/TokenClaimsDisplay.tsx:71:61 - error TS7031: Binding element 'renderCell' implicitly has an 'any' type. 71 <DataGridRow key={rowId}>{({ renderCell }) => {renderCell(item)}} Found 2 errors in the same file, starting at: src/components/TokenClaimsDisplay/TokenClaimsDisplay.tsx:13 (x) Failed: Packaging service backend ERROR: failed packaging service 'backend': failed invoking event handlers for 'prepackage', 'prepackage' hook failed with exit code: '2', Path: 'C:\Users\XXXX\XXX\Local\Temp\azd-prepackage-189254659.ps1'. : exit code: 2 |
Updates, I solved the two by doing "npm i @fluentui/react-table" and claiming the item also for the renderCell in line 72: However, now I am getting this: 63 <DataGrid items={items} columns={columns} sortable getRowId={(item: Claim) => item.name}> node_modules/@types/react/index.d.ts:198:9 src/components/TokenClaimsDisplay/TokenClaimsDisplay.tsx:64:18 - error TS2786: 'DataGridHeader' cannot be used as a JSX component. 64 src/components/TokenClaimsDisplay/TokenClaimsDisplay.tsx:66:25 - error TS2769: No overload matches this call. 66 {({ renderHeaderCell }: { renderHeaderCell: () => React.ReactNode }) => {renderHeaderCell()}} ../../node_modules/@fluentui/react-table/dist/index.d.ts:242:5 src/components/TokenClaimsDisplay/TokenClaimsDisplay.tsx:66:98 - error TS2786: 'DataGridHeaderCell' cannot be used as a JSX component. 66 {({ renderHeaderCell }: { renderHeaderCell: () => React.ReactNode }) => {renderHeaderCell()}} src/components/TokenClaimsDisplay/TokenClaimsDisplay.tsx:72:29 - error TS2322: Type '({ renderCell }: { renderCell: (item: Claim) => React.ReactNode; }) => JSX.Element' is not assignable to type 'CellRenderFunction'. 72 {({ renderCell }: { renderCell: (item: Claim) => React.ReactNode }) => {renderCell(item)}} ../../node_modules/@fluentui/react-table/dist/index.d.ts:242:5 src/components/TokenClaimsDisplay/TokenClaimsDisplay.tsx:72:101 - error TS2786: 'DataGridCell' cannot be used as a JSX component. 72 {({ renderCell }: { renderCell: (item: Claim) => React.ReactNode }) => {renderCell(item)}} Found 6 errors in the same file, starting at: src/components/TokenClaimsDisplay/TokenClaimsDisplay.tsx:63 (x) Failed: Packaging service backend ERROR: failed packaging service 'backend': failed invoking event handlers for 'prepackage', 'prepackage' hook failed with exit code: '2', Path: 'XXX\AppData\Local\Temp\azd-prepackage-477418279.ps1'. : exit code: 2 |
Are there any updates? |
I still haven't managed to replicate the issue, so it is difficult to fix. I looked into that error and found this interesting thread: https://stackoverflow.com/a/72714740/1347623 |
Thank you Pamela, I will look at those ideas |
it's possible i'm pulling in a bad version |
@crampaldo wondering if this will fix your issue |
@crampaldo , @ChoubeTK please let me know if this fixes your issue |
Still getting above errors while I am taking the latest code and trying to make environment up(azd up). |
Did you try explicitly adding scheduler to package.json? Someone mentioned that worked for them. |
Can you please mention specifically what needs to be added and to which file or send some link which can help? |
In app/frontend/package.json, try adding this to dependencies:
And then re-running "npm install" and seeing if you get same error. |
I was getting the 'scheduler error. Adding the dependency suggested solved it for me. My error was exactly like the screenshot posted by ChoubeTK. |
Adding scheduler to package.json solved the issue for me. |
Thank you @pamelafox , will open a PR for this |
This issue is for a: (mark with an
x
)Minimal steps to reproduce
Any log messages given by the failure
Expected/desired behavior
OS and Version?
azd version?
Versions
Mention any other details that might be useful
The text was updated successfully, but these errors were encountered: