Skip to content
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

Server side rendering "TypeError: Reflect$1.getOwnMetadata is not a function" #7476

Closed
lucaswxp opened this issue Aug 22, 2017 · 10 comments
Closed
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity3: broken

Comments

@lucaswxp
Copy link

Bug Report or Feature Request (mark with an x)

- [ x ] bug report -> please search issues before submitting
- [ ] feature request

Versions.

@angular/cli: 1.3.1
node: 7.10.1
os: darwin x64

Repro steps.

Following the docs in https://github.com/angular/angular-cli/blob/1.3.x/docs/documentation/stories/universal-rendering.md

I get

/Users/lucaswxp/xxx/site/node_modules/@angular/core/bundles/core.umd.js:501
            var /** @type {?} */ meta = Reflect$1.getOwnMetadata('propMetadata', target.constructor) || {};
                                                  ^

TypeError: Reflect$1.getOwnMetadata is not a function
    at PropDecorator (/Users/lucaswxp/doare/site/node_modules/@angular/core/bundles/core.umd.js:501:51)
    at __decorate (/Users/lucaswxp/doare/site/node_modules/angular2-text-mask/dist/angular2TextMask.js:5:110)
    at Object.<anonymous> (/Users/lucaswxp/doare/site/node_modules/angular2-text-mask/dist/angular2TextMask.js:88:1)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)

Not sure if it's a angular bug, but I followed all the steps mentioned in the docs. Any help?

@Brocco Brocco added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity3: broken labels Aug 29, 2017
@lucaswxp
Copy link
Author

Guys, I see this is an actual angular cli bug? Any idea how can I fix it temporarily?

@ruyfortini
Copy link

Hello, any updates on this?
I'm about to launch a big project and we need this working.

Appreciate the support.

@ruyfortini
Copy link

@hansl appreaciate if you can give us a date estimate for this fix.

@EmptyPockets
Copy link

@hansl @ruyfortini Is there any temporary way around this bug? Anything at all I can do just to load my site somewhere?

@EmptyPockets
Copy link

@hansl @ruyfortini Quick update, I only get this error if I try to include this plugin: https://github.com/mujtaba01/ngx-owl-carousel. I assume that's not related to the bug but is instead a universal thing?

@BlankHrt
Copy link

BlankHrt commented Sep 15, 2017

same problem with universal
have you solved yet? @lucaswxp @EmptyPockets

@hlszk
Copy link

hlszk commented Sep 18, 2017

I get this error message building an universal project without angular-cli, so I guess it is rather a platform-server issue.

@diegotham
Copy link

I think it is because you are using a dependency that uses methods not supported in node:
http://node.green/#ESNEXT-pre-strawman-Metadata-reflection-API-Reflect-getOwnMetadata

In your case is 'angular2-text-mask'

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Oct 8, 2018

At server level you need to include a reflect polyfill such as reflect-metadata.

Please take a look at this story https://github.com/angular/angular-cli/wiki/stories-universal-rendering and this starter https://github.com/angular/universal-starter/blob/master/server.ts#L2

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent severity3: broken
Projects
None yet
Development

No branches or pull requests

9 participants