Code Monkey home page Code Monkey logo

Comments (8)

pleerock avatar pleerock commented on May 21, 2024

you need to configure your system.js and add mappings to validator and all its dependencies

from class-validator.

st-clair-clarke avatar st-clair-clarke commented on May 21, 2024

angular-cli-build.js

module.exports = function (defaults) {
  return new Angular2App(defaults, {
    vendorNpmFiles: [
            'systemjs/dist/system-polyfills.js',
            'systemjs/dist/system.src.js',
            'zone.js/dist/**/*.+(js|js.map)',
            'es6-shim/es6-shim.js',
            'reflect-metadata/**/*.+(ts|js|js.map)',
            'rxjs/**/*.+(js|js.map)',
            '@angular/**/*.+(js|js.map)',
            '@angular2-material/**/*.js',
            'class-sanitizer/**/*',
            'class-validator/**/*',
            'configuration-manager/**/*',
            'constructor-utils/**/*',
            'event-dispatch/**/*',
            'gulpclass/**/*',
            'immutable/**/*.js',
            'lodash/**/*',
            'typedi/**/*',
        ]
  });
};

system-config.js (relevant parts)

var map = {
  '@angular2-material': 'vendor/@angular2-material',
  'class-sanitizer': 'vendor/class-sanitizer',
  'class-validator': 'vendor/class-validator',
  'configuration-manager': 'vendor/configuration-manager',
  'constructor-utils': 'vendor/constructor-utils',
  'event-dispatch': 'vendor/event-dispatch',
  'gulpclass': 'vendor/gulpclass',
  'immutable': 'vendor/immutable',
  'lodash': 'vendor/lodash',
  'typedi': 'vendor/typedi',
};

var packages = {
...
  'class-validator': {
    // format: 'cjs',
    'defaultExtension': 'js',
    'main': 'index.js'
  },
}

Hoping you can see something wrong with my code above. Thanks.

from class-validator.

pleerock avatar pleerock commented on May 21, 2024

class-validator depends on validator, try to put config to it too:

var map = {
  '@angular2-material': 'vendor/@angular2-material',
  'class-sanitizer': 'vendor/class-sanitizer',
  'class-validator': 'vendor/class-validator',
  'validator': 'vendor/validator',
  'configuration-manager': 'vendor/configuration-manager',
  'constructor-utils': 'vendor/constructor-utils',
  'event-dispatch': 'vendor/event-dispatch',
  'gulpclass': 'vendor/gulpclass',
  'immutable': 'vendor/immutable',
  'lodash': 'vendor/lodash',
  'typedi': 'vendor/typedi',
};

var packages = {
...
  'class-validator': {
    // format: 'cjs',
    'defaultExtension': 'js',
    'main': 'index.js'
  },
  'validator': {
    'defaultExtension': 'js',
    'main': 'index.js'
  },
}

from class-validator.

pleerock avatar pleerock commented on May 21, 2024

is it fixed for you now?

from class-validator.

st-clair-clarke avatar st-clair-clarke commented on May 21, 2024

I am getting the same errors even with the attempted correction you suggested.

from class-validator.

st-clair-clarke avatar st-clair-clarke commented on May 21, 2024

It is not fixed - same problems as started.

from class-validator.

st-clair-clarke avatar st-clair-clarke commented on May 21, 2024

The problem was solved by the following

'validator': {
'defaultExtension': 'js',
'main': 'validator.js'
},

from class-validator.

st-clair-clarke avatar st-clair-clarke commented on May 21, 2024

Closing issue.

from class-validator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.