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

Adding mongoose #14

Open
nourissam opened this issue May 30, 2017 · 3 comments
Open

Adding mongoose #14

nourissam opened this issue May 30, 2017 · 3 comments

Comments

@nourissam
Copy link

i try to add mongoose to the project but i can't succed .i have this error when i try to sstart server;
driver = !(function webpackMissingModule() { var e = new Error("Cannot find module ".""); e.code = 'MODULE_NOT_FOUND'; throw e; }());

if you can help me

@BillyQin
Copy link

i have some question when i try to add jsdom to the project..

@Koslun
Copy link

Koslun commented May 31, 2017

@nourissam @BillyQin you need to have a more complete example to get any meaningful help. So that we can correct your example rather than write the solution for you. Likely better with more details than less.

Like all other opensource github libraries the issue section is not a good place to ask for help. Rather instead ask your question with more complete examples at stackoverflow: https://stackoverflow.com/questions/tagged/angular.

Tag them with angular and maybe more related tags like mongoose or jsdom respectively.

@sylc
Copy link

sylc commented Jun 3, 2017

I had also some issues with mongoose. I fixed it by excluding mongoose from the server bundle.
In webpack.serv.js add "externals" property as below:

module.exports = {
entry: root('./src/main.server.ts'),
output: {
filename: 'server.js'
},
target: 'node',
externals: [
function(context, request, callback) {
if (/mongoose/.test(request)) {
return callback(null, 'commonjs ' + request);
}
if (/colors/.test(request)) {
return callback(null, 'commonjs ' + request);
}
callback();
}
]
};

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

4 participants