question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build error with Angular Universal (SSR)

See original GitHub issue

Hi,

I really like this component and added it to our project to add some emoji support to our community systems (like forum and chats). However, our project is also using Angular Universal. Just adding the PickerModule to the AppModule (which is then imported in the ServerModule gives me this error when running npm run build:ssr. Our stack is pretty standard with Angular 8.2.7 and ngx-emoji-mart with version 1.02.

Thank you very much for this awesome component and I hope this can be resolved quickly.

Cheers, Phillip

This is the error:

ERROR in ./node_modules/@ctrl/ngx-emoji-mart/ngx-emoji/fesm5/ctrl-ngx-emoji-mart-ngx-emoji.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 (/Users/pschuster/Documents/Websites/fourplayers/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:230:35)
    at checkNodeForDecorators (/Users/pschuster/Documents/Websites/fourplayers/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:53:21)
    at visitNodes (/Users/pschuster/Documents/Websites/fourplayers/node_modules/typescript/lib/typescript.js:16631:30)
    at Object.forEachChild (/Users/pschuster/Documents/Websites/fourplayers/node_modules/typescript/lib/typescript.js:16857:24)
    at checkNodeForDecorators (/Users/pschuster/Documents/Websites/fourplayers/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:44:31)
    at visitNode (/Users/pschuster/Documents/Websites/fourplayers/node_modules/typescript/lib/typescript.js:16622:24)
    at Object.forEachChild (/Users/pschuster/Documents/Websites/fourplayers/node_modules/typescript/lib/typescript.js:16752:21)
    at checkNodeForDecorators (/Users/pschuster/Documents/Websites/fourplayers/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:44:31)
    at visitNode (/Users/pschuster/Documents/Websites/fourplayers/node_modules/typescript/lib/typescript.js:16622:24)
    at Object.forEachChild (/Users/pschuster/Documents/Websites/fourplayers/node_modules/typescript/lib/typescript.js:16809:24)
    at checkNodeForDecorators (/Users/pschuster/Documents/Websites/fourplayers/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:44:31)
    at visitNode (/Users/pschuster/Documents/Websites/fourplayers/node_modules/typescript/lib/typescript.js:16622:24)
    at Object.forEachChild (/Users/pschuster/Documents/Websites/fourplayers/node_modules/typescript/lib/typescript.js:16820:24)
    at checkNodeForDecorators (/Users/pschuster/Documents/Websites/fourplayers/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:44:31)
    at visitNode (/Users/pschuster/Documents/Websites/fourplayers/node_modules/typescript/lib/typescript.js:16622:24)
    at Object.forEachChild (/Users/pschuster/Documents/Websites/fourplayers/node_modules/typescript/lib/typescript.js:16716:21)
    at checkNodeForDecorators (/Users/pschuster/Documents/Websites/fourplayers/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:44:31)
    at visitNodes (/Users/pschuster/Documents/Websites/fourplayers/node_modules/typescript/lib/typescript.js:16631:30)
    at Object.forEachChild (/Users/pschuster/Documents/Websites/fourplayers/node_modules/typescript/lib/typescript.js:16866:24)
    at checkNodeForDecorators (/Users/pschuster/Documents/Websites/fourplayers/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:44:31)
    at visitNode (/Users/pschuster/Documents/Websites/fourplayers/node_modules/typescript/lib/typescript.js:16622:24)
    at Object.forEachChild (/Users/pschuster/Documents/Websites/fourplayers/node_modules/typescript/lib/typescript.js:16864:21)
    at checkNodeForDecorators (/Users/pschuster/Documents/Websites/fourplayers/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:44:31)
    at visitNodes (/Users/pschuster/Documents/Websites/fourplayers/node_modules/typescript/lib/typescript.js:16631:30)
    at Object.forEachChild (/Users/pschuster/Documents/Websites/fourplayers/node_modules/typescript/lib/typescript.js:16859:24)
    at transformer (/Users/pschuster/Documents/Websites/fourplayers/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:39:16)
    at transformSourceFileOrBundle (/Users/pschuster/Documents/Websites/fourplayers/node_modules/typescript/lib/typescript.js:67384:57)
    at transformation (/Users/pschuster/Documents/Websites/fourplayers/node_modules/typescript/lib/typescript.js:83586:24)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
scttcpercommented, Dec 5, 2019

🎉 This issue has been resolved in version 1.0.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

1reaction
y4m4tocommented, Nov 22, 2019

I’m having the same issue using version 1.0.3 with Angular 8.3.1.

ERROR in /Users/yamato.aizawa/hrmony-prf/web/node_modules/@ctrl/ngx-emoji-mart/fesm2015/ctrl-ngx-emoji-mart.js
Module build failed (from /Users/yamato.aizawa/hrmony-prf/web/node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js):
TypeError: Cannot read property 'kind' of undefined
    at isAngularDecoratorMetadataExpression (/Users/yamato.aizawa/hrmony-prf/web/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:230:35)
    at checkNodeForDecorators (/Users/yamato.aizawa/hrmony-prf/web/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:53:21)
    at visitNodes (/Users/yamato.aizawa/hrmony-prf/web/node_modules/typescript/lib/typescript.js:16631:30)
    at Object.forEachChild (/Users/yamato.aizawa/hrmony-prf/web/node_modules/typescript/lib/typescript.js:16859:24)
    at transformer (/Users/yamato.aizawa/hrmony-prf/web/node_modules/@angular-devkit/build-optimizer/src/transforms/scrub-file.js:39:16)
    at transformSourceFileOrBundle (/Users/yamato.aizawa/hrmony-prf/web/node_modules/typescript/lib/typescript.js:67384:57)
    at transformation (/Users/yamato.aizawa/hrmony-prf/web/node_modules/typescript/lib/typescript.js:83586:24)
    at transformRoot (/Users/yamato.aizawa/hrmony-prf/web/node_modules/typescript/lib/typescript.js:83606:82)
    at Object.map (/Users/yamato.aizawa/hrmony-prf/web/node_modules/typescript/lib/typescript.js:499:29)
    at Object.transformNodes (/Users/yamato.aizawa/hrmony-prf/web/node_modules/typescript/lib/typescript.js:83593:30)
    at emitJsFileOrBundle (/Users/yamato.aizawa/hrmony-prf/web/node_modules/typescript/lib/typescript.js:84089:32)
    at emitSourceFileOrBundle (/Users/yamato.aizawa/hrmony-prf/web/node_modules/typescript/lib/typescript.js:84043:13)
    at forEachEmittedFile (/Users/yamato.aizawa/hrmony-prf/web/node_modules/typescript/lib/typescript.js:83832:34)
    at Object.emitFiles (/Users/yamato.aizawa/hrmony-prf/web/node_modules/typescript/lib/typescript.js:84026:9)
    at emitWorker (/Users/yamato.aizawa/hrmony-prf/web/node_modules/typescript/lib/typescript.js:89951:33)
    at /Users/yamato.aizawa/hrmony-prf/web/node_modules/typescript/lib/typescript.js:89912:66
    at runWithCancellationToken (/Users/yamato.aizawa/hrmony-prf/web/node_modules/typescript/lib/typescript.js:90002:24)
    at Object.emit (/Users/yamato.aizawa/hrmony-prf/web/node_modules/typescript/lib/typescript.js:89912:20)
    at Object.transformJavascript (/Users/yamato.aizawa/hrmony-prf/web/node_modules/@angular-devkit/build-optimizer/src/helpers/transform-javascript.js:111:13)
    at Object.buildOptimizer (/Users/yamato.aizawa/hrmony-prf/web/node_modules/@angular-devkit/build-optimizer/src/build-optimizer/build-optimizer.js:119:35)
    at Object.buildOptimizerLoader (/Users/yamato.aizawa/hrmony-prf/web/node_modules/@angular-devkit/build-optimizer/src/build-optimizer/webpack-loader.js:40:40)

But it worked by using version 1.0.1 🤔

Read more comments on GitHub >

github_iconTop Results From Across the Web

SSR build failed issue #2449 - angular/universal - GitHub
If the problem persists in your application after upgrading, please open a new issue, provide a simple repository reproducing the problem, and ...
Read more >
Server-side rendering (SSR) with Angular Universal
This guide describes Angular Universal, a technology that renders Angular applications on the server. A normal Angular application executes in the browser, ...
Read more >
How to handle Server and Client errors in Angular Universal ...
So here is were angular platform id and isPlatformServer method come into play and we can use those to take different paths on...
Read more >
Page crash after converting to Angular Universal (SSR)
Sorry, I misread your question. The issue is that you're using something (I guess it's ngbRunTransition) that calls getBoundingClientRect .
Read more >
Angular Universal: Complete Practical Guide
This post will be a complete practical guide for getting started with Angular Universal. We are going to go start with an existing...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found