emberjs / ember.js

Ember.js - A JavaScript framework for creating ambitious web applications
https://emberjs.com
MIT License
22.45k stars 4.21k forks source link

v2.0.3 dist files are broken #12820

Closed rogatty closed 8 years ago

rogatty commented 8 years ago

After doing bower install ember#2.0.3 our build step no longer works. It fails with:

/front/vendor/ember/ember-template-compiler.js:1
(function (exports, require, module, __filename, __dirname) { enifed("backburn
TypeError: undefined is not a function

After checking vendor/ember/ I can see that all files miss these 116 lines comparing to the v2.0.2:

/*!
 * @overview  Ember - JavaScript Application Framework
 * @copyright Copyright 2011-2015 Tilde Inc. and contributors
 *            Portions Copyright 2006-2011 Strobe Inc.
 *            Portions Copyright 2008-2011 Apple Inc. All rights reserved.
 * @license   Licensed under MIT license
 *            See https://raw.github.com/emberjs/ember.js/master/LICENSE
 * @version   2.0.2
 */

(function() {
var enifed, requireModule, eriuqer, requirejs, Ember;
var mainContext = this;

(function() {
  var isNode = typeof window === 'undefined' &&
    typeof process !== 'undefined' && {}.toString.call(process) === '[object process]';

  if (!isNode) {
    Ember = this.Ember = this.Ember || {};
  }

  if (typeof Ember === 'undefined') { Ember = {}; };

  if (typeof Ember.__loader === 'undefined') {
    var registry = {};
    var seen = {};

    enifed = function(name, deps, callback) {
      var value = { };

      if (!callback) {
        value.deps = [];
        value.callback = deps;
      } else {
        value.deps = deps;
        value.callback = callback;
      }

      registry[name] = value;
    };

    requirejs = eriuqer = requireModule = function(name) {
      return internalRequire(name, null);
    }

    function internalRequire(name, referrerName) {
      var exports = seen[name];

      if (exports !== undefined) {
        return exports;
      }

      exports = seen[name] = {};

      if (!registry[name]) {
        if (referrerName) {
          throw new Error('Could not find module ' + name + ' required by: ' + referrerName);
        } else {
          throw new Error('Could not find module ' + name);
        }
      }

      var mod = registry[name];
      var deps = mod.deps;
      var callback = mod.callback;
      var reified = [];
      var length = deps.length;

      for (var i=0; i<length; i++) {
        if (deps[i] === 'exports') {
          reified.push(exports);
        } else {
          reified.push(internalRequire(resolve(deps[i], name), name));
        }
      }

      callback.apply(this, reified);

      return exports;
    };

    function resolve(child, name) {
      if (child.charAt(0) !== '.') {
        return child;
      }
      var parts = child.split('/');
      var parentBase = name.split('/').slice(0, -1);

      for (var i=0, l=parts.length; i<l; i++) {
        var part = parts[i];

        if (part === '..') {
          parentBase.pop();
        } else if (part === '.') {
          continue;
        } else {
          parentBase.push(part);
        }
      }

      return parentBase.join('/');
    }

    requirejs._eak_seen = registry;

    Ember.__loader = {
      define: enifed,
      require: eriuqer,
      registry: registry
    };
  } else {
    enifed = Ember.__loader.define;
    requirejs = eriuqer = requireModule = Ember.__loader.require;
  }
})();

Probably something happened during the build process?

rwjblue commented 8 years ago

Hmm. Sorry about that. I'm looking into this...

justinaray commented 8 years ago

@rwjblue I am also seeing a problem with the ember-template-compiler. Not sure if it is related, but wanted to provide it here.

TypeError: enifed is not a function
  at Object.<anonymous> (/Users/jray/code/web-auth-service/bower_components/ember/ember-template-compiler.js:1:63)

Happened after the 2.0.3 upgrade and a nombom.

shawndumas commented 8 years ago

This is hitting us too...

 TypeError: undefined is not a function
     at Object.<anonymous> (buildAgent/frontend/bower_components/ember/ember-template-compiler.js:1:63)
     at Module._compile (module.js:460:26)
     at Object.Module._extensions..js (module.js:478:10)
     at Module.load (module.js:355:32)
     at Function.Module._load (module.js:310:12)
     at Module.require (module.js:365:17)
     at require (module.js:384:17)
     at Class.module.exports.included (buildAgent/frontend/node_modules/ember-cli-htmlbars-inline-precompile/index.js:17:20)
     at EmberApp.<anonymous> (buildAgent//frontend/node_modules/ember-cli/lib/broccoli/ember-app.js:328:15)
     at Array.filter (native)
justinaray commented 8 years ago

@shawndumas fyi ... rwj confirmed on slack (needhelp channel) that this is a problem with 2.0.3. No word on a fix yet. In the mean time, I am also considering an upgrade to 2.1.0. Don't think it's a big lift from 2.0.3.

shawndumas commented 8 years ago

ty

shawndumas commented 8 years ago

does anyone know the change that went into morph-range, I'm not seeing the commit. I need to create a custom build locally to work around 2.0.3 hotpatch dist failing

rwjblue commented 8 years ago

@shawndumas - https://gist.github.com/rwjblue/a1292fa795d9673ab671

I believe I have fixed the build issue, and am updating the assets in S3 and bower.

rwjblue commented 8 years ago

bower builds are fixed:

https://github.com/components/ember/compare/2.0.2...2.0.3

justinaray commented 8 years ago

:clap: Thanks @rwjblue

I know you can't buy a :beer: anywhere you go and I hope to continue that phenomenon!

shawndumas commented 8 years ago

:cake:

rogatty commented 8 years ago

Thanks, works fine now.

YoranBrondsema commented 8 years ago

Thanks @rwjblue! Just for those who had this problem, make sure you clean the Bower cache (bower cache clean) before you reinstall Ember.js 2.0.3.