New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"define" is not defined error. Broken build #1768

Closed
mgol opened this Issue Oct 21, 2014 · 4 comments

Comments

Projects
None yet
2 participants
@mgol
Member

mgol commented Oct 21, 2014

Originally reported by corbacho at: http://bugs.jquery.com/ticket/15061

When building a custom jQuery (master branch) with this command:

grunt build:*:+core/ready

It will output about the line 47:

define("jquery", function(){});

This produces the error

ReferenceError: define is not defined

Why I'm using grunt build? I know that "grunt custom" is the recommended alias, but I'm trying to build a minimum possible jQuery that contains the necessary code for a reliable $(document).ready() . I want to propose this solution to be part of the upcoming Drupal 8 core, as an alternative to domready solution  https://github.com/ded/domready that we are using now

The whole command is :

grunt build:*:+core/ready:+exports/global:-exports/amd:-ajax:-ajax/xhr:-ajax/script:-ajax/jsonp:-css:-deprecated:-dimensions:-effects:-event:-event/alias:-offset:-wrap:-sizzle:-queue:-data:-css:-selector:-traversing:-serialize

This builds a 11Kb size domready solution. 5Kb gzipped

Removing the buggy line mentioned before, it works:  http://jsfiddle.net/WnhWc/2/

Issue reported for jQuery 2.1.0

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Oct 21, 2014

Member

Comment author: corbacho

Ignore the jsfiddle link. These are correct:
The bug  http://jsfiddle.net/WnhWc/4/
The fixed one (removing line 47)  http://jsfiddle.net/WnhWc/3/

Member

mgol commented Oct 21, 2014

Comment author: corbacho

Ignore the jsfiddle link. These are correct:
The bug  http://jsfiddle.net/WnhWc/4/
The fixed one (removing line 47)  http://jsfiddle.net/WnhWc/3/

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Oct 21, 2014

Member

Comment author: corbacho

I reduced the bug to this command (building an empty jQuery)

grunt build:*

it contains these 2 lines:

define([]);
define("jquery", function(){});
Member

mgol commented Oct 21, 2014

Comment author: corbacho

I reduced the bug to this command (building an empty jQuery)

grunt build:*

it contains these 2 lines:

define([]);
define("jquery", function(){});
@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Oct 21, 2014

Member

Comment author: dmethvin

Thanks for reducing it more. I'll mark this open, patches or further testing welcome.

Member

mgol commented Oct 21, 2014

Comment author: dmethvin

Thanks for reducing it more. I'll mark this open, patches or further testing welcome.

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Oct 21, 2014

Member

Comment author: corbacho

Pull request that fix one of the issues:

define([]);

 #1569
Working now on fixing the other "define" that shouldn't be there (They are not related)

Member

mgol commented Oct 21, 2014

Comment author: corbacho

Pull request that fix one of the issues:

define([]);

 #1569
Working now on fixing the other "define" that shouldn't be there (They are not related)

dmethvin added a commit that referenced this issue Dec 4, 2014

@dmethvin dmethvin closed this in 2c1b556 Dec 4, 2014

@dmethvin dmethvin added this to the 3.0.0 milestone Dec 8, 2014

@dmethvin dmethvin added the Build label Dec 8, 2014

markelog added a commit that referenced this issue Nov 10, 2015

@dmethvin dmethvin modified the milestones: 1.12/2.2, 3.0.0 Jan 7, 2016

@cssmagic cssmagic referenced this issue May 18, 2016

Open

jQuery #5

@lock lock bot locked as resolved and limited conversation to collaborators Jun 19, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.