Skip to content

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

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

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

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

mgol opened this issue Oct 21, 2014 · 4 comments
Labels
Milestone

Comments

@mgol
Copy link
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
Copy link
Member Author

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
Copy link
Member Author

mgol commented Oct 21, 2014

Comment author: dmethvin

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

@mgol
Copy link
Member Author

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 pushed a commit that referenced this issue 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 pushed a commit that referenced this issue Nov 10, 2015
@dmethvin dmethvin modified the milestones: 1.12/2.2, 3.0.0 Jan 7, 2016
@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.
Labels
Development

No branches or pull requests

2 participants