Skip to content

jQuery is not defined after migrating to Laravel 5.4 #17634

@DominiqueFERET

Description

@DominiqueFERET
  • Laravel Version: 5.4.6
  • PHP Version: 7.0.13

Description:

After migrating to Laravel 5.4 => javascript bug => ReferenceError: jQuery is not defined
(With Elixir in 5.3 everything works fine.)
This variable is defined in asset/js/bootstrap.js
window.$ = window.jQuery = require('jquery');
in javascript console, i see "$" is correctly defined and a variable name jQuery311052537473254022181 is define...

Seem to be a suffix added ... A bug of wepack config of laravel.mix ???

Steps To Reproduce:

Make a simple javascript closure like
function()({ ... })(jQuery);

then compile assets with command "npm run dev" (same thing with npm run production).

When you try the javascript closure => jQuery is not defined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions