metafizzy / metafizzy/packery

laravel mix/webpack ERROR Module not found: Error: Can't resolve 'jquery'

Open
#553 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
4.3k
Forks
324
PR merge metrics
No merged PRs in 30d

Description

Hi,
I'm using a clean Laravel install and using Packery with vanilla Javascript (sans Jquery).
It works perfectly using a cdn include but when I replace that script with an NPM require if fails:

`ERROR in ./node_modules/packery/dist/packery.pkgd.min.js
Module not found: Error: Can't resolve 'jquery' in '/var/www/jetstream/node_modules/packery/dist'`

I simply install via `NPM`
then add `mix.js('node_modules/packery/dist/packery.pkgd.min.js','public/js')` to my webpack.mix.js
When I `npm run dev` it fails with the error above.

Is this to be expected?
Do I really need jQuery for it to compile?

Thanks.

Contributor guide

Open the contributing guide

Research direction

Start with webpack.mix.js and the Packery entry point at node_modules/packery/dist/packery.pkgd.min.js, then reproduce the failure with npm run dev. Determine whether the bundled build is expected to require jquery and verify that the dependency-resolution behavior is corrected or clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, jquery, laravel, webpack
Domain
build-system, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.