Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why when i want to ng build --prod this problem showed?

ERROR in ./node_modules/ng2-pdf-viewer/fesm5/ng2-pdf-viewer.js Module build failed (from ./node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js): TypeError: Cannot read property 'kind' of undefined at isAngularDecoratorMetadataExpression (E:\Mohamed Mostafa Work\new_project\reservation\node_modules@angular-devkit\build-optimizer\src\transforms\scrub-file.js:265:35) at checkNodeForDecorators (E:\Mohamed Mostafa Work\new_project\reservation\node_modules@angular-devkit\build-optimizer\src\transforms\scrub-file.js:77:21) at visitNodes (E:\Mohamed Mostafa Work\new_project\reservation\node_modules@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16144:30) at Object.forEachChild (E:\Mohamed Mostafa Work\new_project\reservation\node_modules@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16370:24) at checkNodeForDecorators (E:\Mohamed Mostafa Work\new_project\reservation\node_modules@angular-devkit\build-optimizer\src\transforms\scrub-file.js:68:31) at visitNode (E:\Mohamed Mostafa Work\new_project\reservation\node_modules@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16135:24) at Object.forEachChild (E:\Mohamed Mostafa Work\new_project\reservation\node_modules@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16265:21) at checkNodeForDecorators (E:\Mohamed Mostafa Work\new_project\reservation\node_modules@angular-devkit\build-optimizer\src\transforms\scrub-file.js:68:31) at visitNode (E:\Mohamed Mostafa Work\new_project\reservation\node_modules@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16135:24) at Object.forEachChild (E:\Mohamed Mostafa Work\new_project\reservation\node_modules@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16322:24) at checkNodeForDecorators (E:\Mohamed Mostafa Work\new_project\reservation\node_modules@angular-devkit\build-optimizer\src\transforms\scrub-file.js:68:31) at visitNode (E:\Mohamed Mostafa Work\new_project\reservation\node_modules@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16135:24) at Object.forEachChild (E:\Mohamed Mostafa Work\new_project\reservation\node_modules@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16333:24) at checkNodeForDecorators (E:\Mohamed Mostafa Work\new_project\reservation\node_modules@angular-devkit\build-optimizer\src\transforms\scrub-file.js:68:31) at visitNode (E:\Mohamed Mostafa Work\new_project\reservation\node_modules@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16135:24) at Object.forEachChild (E:\Mohamed Mostafa Work\new_project\reservation\node_modules@angular-devkit\build-optimizer\node_modules\typescript\lib\typescript.js:16229:21)

like image 263
mohame mostafa Avatar asked Dec 17 '22 14:12

mohame mostafa


1 Answers

I got same error but finally resolved with following solution.. Unistall ng2-pdf-viewer viewer first then install - npm install [email protected]

like image 91
Nilima Avatar answered Dec 29 '22 07:12

Nilima