mongoose-schema-to-graphql
mongoose-schema-to-graphql copied to clipboard
It's not a commonJS module
const createType = require('mongoose-schema-to-graphql')
// built index.js line 291
exports.default = createType;
not work
Hi, just try:
const createType = require('mongoose-schema-to-graphql').default;
or
import createType from 'mongoose-schema-to-graphql';
.default not work, I have tried
ES6 import can not work without babel. For now, ES6 module still not an accepted standard for nodeJS, so I only use ES6 module in frontend with package tool, for backend I never use it or mix it with commonJS, it will cause a lot of problems
try new version from npm 2.7.1 it should be compatible with commonJS
Works, Thanks a million