node_modules/@angular/core/bundles/core.umd.js:501
var /** @type {?} */ meta = Reflect$1.getOwnMetadata('propMetadata', target.constructor) || {};
^^
TypeError: Reflect$1.getOwnMetadata๋ ํจ์๊ฐ ์๋๋๋ค.
PropDecorator์์
@dkmostafa , ์ค๋ฅ๊ฐ ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ๊ด๋ จ์ด ์๋ค๊ณ ํ์ ํฉ๋๊น? ์คํ ์ถ์ ์์ node_modules/bundles/core.umd.js(์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ํฌํจ๋์ง ์์)์ ์ค๋ฅ๊ฐ ์๋ ๊ฒ์ฒ๋ผ ๋ณด์ ๋๊น? ng-lazyload-image ๊ฐ์ ธ์ค๊ธฐ๋ฅผ ์ ๊ฑฐํด๋ ์ด ์ค๋ฅ๊ฐ ๊ณ์ ๋ฐ์ํฉ๋๊น?
ng-lazyload-image ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ ๊ฑฐํ๊ณ app.module.ts์์ ์ ๊ฑฐํ ํ ํ๋ก์ ํธ๊ฐ ์๋ฒฝํ๊ฒ ์๋ํ์ต๋๋ค.
์ด๊ฒ์ ์ค๋ฅ์ ์ ์ฒด ์ถ์ ์ ๋๋ค.
TypeError: Reflect$1.getOwnMetadata๋ ํจ์๊ฐ ์๋๋๋ค.
PropDecorator์์ (/project/node_modules/@angular/core/bundles/core.umd.js:501:51)
__decorate(/project/node_modules/ng-lazyload-image/src/lazyload-image.directive.js:5:110)์์
project/node_modules/ng-lazyload-image/src/lazyload-image.directive.js:62:5์์
๊ฐ์ฒด์์.
Module._compile์์ (module.js:570:32)
Object.Module._extensions..js์์ (module.js:579:10)
Module.load์์ (module.js:487:32)
tryModuleLoad์์(module.js:446:12)
Function.Module._load์์ (module.js:438:3)
Module.require์์ (module.js:497:17)
์, ์ด ํ๋ฌ๊ทธ์ธ์ ์ค์นํ ํ์๋ ๋์ผํ ๋ฌธ์ ๊ฐ ์์ต๋๋ค. @angular/cli๋ ng build --prod
๋ฅผ ํตํด ์ฑ์ ๋น๋ํ์ง๋ง ์๋ฒ ์ธก์์ TypeError
์์ ์ฝ๋๋ฅผ ์คํํ๋ ค๊ณ ํ๋ฉด ๋ฐ์ํฉ๋๋ค.
์ผ๋ถ ์ข
์์ฑ์์ ๋ฐ์ํฉ๋๋ค.
https://github.com/angular/angular-cli/issues/7476
์ ๋๋ฒ์ค์ ์ฌ์ฉํ ๋
Node๊ฐ ์ง์ํ์ง ์๋ ๋ฉํ๋ฐ์ดํฐ ๋ฆฌํ๋ ์ API(getOwnMetadata)๊ฐ ํ์ํ ๊ณณ
์ธํฐ๋ท ๊ฒ์์ ํด๋ณด๋ ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ ์๋ angular-cli/universal์์ ๋ฌธ์ ๊ฐ ์๋ ๊ฒ ๊ฐ์ต๋๋ค. ๋ด๊ฐ ํ๋ ธ๋ค๋ฉด ์๋ ค์ฃผ์ธ์!
server.ts
ํ์ผ์ import 'core-js/es7/reflect';
๋๋ import 'reflect-metadata';
๊ฐ์ ธ์ค๊ธฐ์ ๋งจ ์์ ์ด ํ์ ํฌํจํด์ผ ํฉ๋๋ค.
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
server.ts
ํ์ผ์import 'core-js/es7/reflect';
๋๋import 'reflect-metadata';
๊ฐ์ ธ์ค๊ธฐ์ ๋งจ ์์ ์ด ํ์ ํฌํจํด์ผ ํฉ๋๋ค.