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

Using Material ? #4

Open
dr1ss opened this issue Jan 12, 2018 · 2 comments
Open

Using Material ? #4

dr1ss opened this issue Jan 12, 2018 · 2 comments

Comments

@dr1ss
Copy link

dr1ss commented Jan 12, 2018

Hello guys,
I'm trying to implement Material to the seed (angular/material and angular/cdk)

I've added the following module to app.module.ts :

import { NgModule } from '@angular/core';
import { MatButtonModule, MatCardModule, MatIconModule, MatInputModule, MatMenuModule, MatToolbarModule } from '@angular/material';

@NgModule({
    exports: [
        MatButtonModule,
        MatCardModule,
        MatIconModule,
        MatInputModule,
        MatMenuModule,
        MatToolbarModule
    ]
})
export class MaterialModule {
}

Then just as a test I've added a button to the template :

<button mat-button>Click me!</button>

I get an error when I try to start the server after a "build:prod" :

/Volumes/Secondary/git/xxxx/dist/server.js:198766
module.exports = ../../node_modules/@angular/material/button/typings/index.ngfactory;
                 ^

SyntaxError: Unexpected token .
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:599:28)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Function.Module.runMain (module.js:676:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1

Any idea what's going on here please ?

@lhgrigio
Copy link

Any luck on this issue? i'm trying to solve it myself

@lhgrigio
Copy link

It appears that the node file is generated without the relative path to the factories without being a string, after a few more issues i decided to use this fork: https://github.com/malikov917/angular-universal-seed/
It's working on my current project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants