You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When building an Angular project that uses class-validator, Angular generates a large number of warnings regarding CommonJS dependencies.
As you can see in the example below, I can simply import from class-validator without explicitly having to specify class-validator/esm2015.
import { IsEmail } from 'class-validator';
The bundling will automatically use \node_modules\class-validator\esm2015.
However, it is not automatically using \node_modules\validator\es, which results in all the warnings (see below).
Warning: C:\Users\Me\Documents\MyProject\node_modules\class-validator\esm2015\decorator\string\IsEmail.js depends on 'validator/lib/isEmail'. CommonJS or AMD dependencies can cause optimization bailouts.
For more info see: https://angular.io/guide/build#configuring-commonjs-dependencies
The above warning is generated for every validator, whether it's used or not.
Additional context
Validator.js version: 13.6.0
Node.js version:
OS platform: windows 10
Describe the bug
When building an Angular project that uses class-validator, Angular generates a large number of warnings regarding CommonJS dependencies.
As you can see in the example below, I can simply import from
class-validator
without explicitly having to specifyclass-validator/esm2015
.The bundling will automatically use
\node_modules\class-validator\esm2015
.However, it is not automatically using
\node_modules\validator\es
, which results in all the warnings (see below).A solution is suggested by @NoNameProvided in this thread.
Examples
The above warning is generated for every validator, whether it's used or not.
Additional context
Validator.js version: 13.6.0
Node.js version:
OS platform: windows 10
The text was updated successfully, but these errors were encountered: