Opened 9 years ago
Closed 8 years ago
#15061 closed bug (migrated)
"define" is not defined error. Broken build
Reported by: | corbacho | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | build | Version: | 2.1.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
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/
Change History (5)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
I reduced the bug to this command (building an empty jQuery)
grunt build:*
it contains these 2 lines:
define([]); define("jquery", function(){});
comment:3 Changed 9 years ago by
Component: | unfiled → build |
---|---|
Priority: | undecided → low |
Status: | new → open |
Thanks for reducing it more. I'll mark this open, patches or further testing welcome.
comment:4 Changed 9 years ago by
Pull request that fix one of the issues:
define([]);
https://github.com/jquery/jquery/pull/1569 Working now on fixing the other "define" that shouldn't be there (They are not related)
comment:5 Changed 8 years ago by
Resolution: | → migrated |
---|---|
Status: | open → closed |
Migrated to https://github.com/jquery/jquery/issues/1768
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/