question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Webpack build with version 3.2.8 is failing

See original GitHub issue

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...
  ]
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:19 (7 by maintainers)

github_iconTop GitHub Comments

8reactions
colindekkercommented, Apr 18, 2018

For people using webpack, the easiest option is to alias jquery.validate in the resolve block of webpack. Below tested with Webpack 4 (latest) and latest versions of both jquery-validation and jquery-validation-unobtrusive. This way there is no need to hack the jquery-validation-unobtrusive package files, and when the offending lines are fixed in a next release your webpack build will keep working.

alias: {
  "jquery.validation': "jquery-validation/dist/jquery.validate.js" 
},
7reactions
li0nsar3c00lcommented, Apr 7, 2018

Since CI/CD is not implemented, when will this fix be pushed to npm?

Read more comments on GitHub >

github_iconTop Results From Across the Web

webpack is failing while trying to compile in production mode
I've been using React 16.x.x and Jqwidgets 6.2.0 and React Boilerplate 3.7.0. My whole project was mounted over the React Boilerplate ...
Read more >
JupyterLab Changelog — JupyterLab 3.6.0b0 documentation
Recommend trying prebuilt extension version in the build failure dialog #11476 (@krassowski) ... Use standard hash type in webpack build #11234 (@blink1073).
Read more >
Problems while analyzing webpack config file : WEB-43489
Can't analyse webpack2.config.js: coding assistance will ignore module resolution rules in this file. Possible reasons: this file is not a valid webpack ......
Read more >
ionic-app-scripts-plus - NPM Package Overview
Version : 3.2.8 was published by yoneyy. Start using Socket to analyze ionic-app-scripts-plus and its 28 dependencies to secure your app from ...
Read more >
frsource/cypress-plugin-visual-regression-diff
Perform visual regression test with a nice GUI as help. Only for Cypress!. Latest version: 3.2.8, last published: 7 days ago.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found