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

ngfactory not found !! #12

Open
kamalkech opened this issue Mar 21, 2017 · 8 comments
Open

ngfactory not found !! #12

kamalkech opened this issue Mar 21, 2017 · 8 comments

Comments

@kamalkech
Copy link

in this demo u can't found ngfactory

@esakkik
Copy link

esakkik commented Mar 24, 2017

Same issue
image

@MarkPieszak
Copy link

MarkPieszak commented Mar 25, 2017

Use this repo (it has client & server rendering and is up to date): https://github.com/FrozenPandaz/ng-universal-demo @kamalkech @esakkikrishnan

@mariohmol
Copy link

@MarkPieszak i tryed to use this repo..it works.. but i'm trying to put mongoose but can t work at all.. and this repo is not able to open issues to discuss.. do you know how to make it compile with mongo? thanks!

@MarkPieszak
Copy link

Why wouldn't mongo work it's outside of Angular & SSR itself?
What errors are you getting, must be setting up mongo wrong somewhere?

@mariohmol
Copy link

What i have is:
I'm trying to include this import * as mongoose from 'mongoose';

  • if I do import in main.server.ts it works
  • if i have a file in same folder like .\server\user\routes.jsand I use the same import, it give me the error (the build works but the npm start gives me the error:

IN build process:

 WARNING in ./~/mongodb/~/es6-promise/dist/es6-promise.js
    Module not found: Error: Can't resolve 'vertx' in '/Users/mariohmol/projetos/netgas/v2/web/node_modules/
mongodb/node_modules/es6-promise/dist'
     @ ./~/mongodb/~/es6-promise/dist/es6-promise.js 131:20-30

In server process:

"stack": [
    "Error: Cannot find module \".\"",
    "    at new Error (native)",

@mariohmol
Copy link

I think i found it.. is need to change the webpack.server.js to have the webpack-node-externals

const { root } = require('./helpers');

const { AotPlugin } = require('@ngtools/webpack');
var nodeExternals = require('webpack-node-externals');

/**
 * This is a server config which should be merged on top of common config
 */
module.exports = {
  entry: root('./src/main.server.ts'),
  output: {
    filename: 'server.js'
  },
  target: 'node',
  externals: [nodeExternals({
      modulesFromFile: true
  })]
};

@harshes53
Copy link

npm install '@angular/animations' -- save

@SystemDisc
Copy link

SystemDisc commented Jul 4, 2017

npm i -S @angular/animations fixed it for me. It's an "unmet peer dependency" when running npm install

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

6 participants