Skip to content

Webpack build with version 3.2.8 is failing #79

Closed
@martijnboland

Description

@martijnboland

When using the latest version from NPM (3.2.8) with webpack, the following error occurres:

ERROR in ./node_modules/jquery-validation-unobtrusive/dist/jquery.validate.unobtrusive.js
Module not found: Error: Can't resolve 'jquery.validate' in '[path]\node_modules\jquery-validation-unobtrusive\dist'
 @ ./node_modules/jquery-validation-unobtrusive/dist/jquery.validate.unobtrusive.js 11:8-75
 @ multi bootstrap jquery jquery-validation jquery-validation-unobtrusive popper.js

I think webpack tries to resolve jquery.validate as a dependency (via AMD define) but it fails because it's probably known within webpack as jquery-validation. A workaround is to add the following rule to the webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false,
      }
    }, 
   ...other rules...
  ]
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions