emberjs/ember-inflector

Failure in ember addon with 3.2.0-beta.1

paulcwatts opened this issue · 4 comments

This is using ember-cli==3.1.0, ember-source==3.1.0:

ember addon ember-inflector-bug --yarn
cd ember-inflector-bug
ember install ember-data 
ember try:one ember-beta

The result is:

not ok 1 Chrome 65.0 - Global error: Uncaught TypeError: Cannot read property 'String' of undefined at http://localhost:7357/assets/vendor.js, line 65295
    ---
        Log: |
            { type: 'warn',
              text: '\'WARNING: Library "Ember" is already registered with Ember.\'\n' }
            { type: 'error',
              text: 'Uncaught TypeError: Cannot read property \'String\' of undefined at http://localhost:7357/assets/vendor.js, line 65295\n' }
    ...
not ok 2 Chrome 65.0 - Global error: Uncaught Error: Assertion Failed: The tests file was not loaded. Make sure your tests index.html includes "assets/tests.js". at http://localhost:7357/assets/vendor.js, line 24850
    ---
        Log: |
            { type: 'error',
              text: 'Uncaught Error: Assertion Failed: The tests file was not loaded. Make sure your tests index.html includes "assets/tests.js". at http://localhost:7357/assets/vendor.js, line 24850\n' }

The actual error is located here:

define('ember-inflector/lib/ext/string', ['ember-inflector/lib/system/string'], function (_string) {
  'use strict';

  if (Ember.EXTEND_PROTOTYPES === true || Ember.EXTEND_PROTOTYPES.String) {

@paulcwatts did you find a work around?

@kiwiupover My "workaround" was to disable ember-beta and ember-canary in my ember try configuration. I don't know off-hand of any workaround, but if you can define Ember.EXTEND_PROTOTYPES it should be able to work.

@kiwiupover ' s answer was the only fix that helped me with my Ember quiz. Inserting ember-inflector into the devDependencies object of package.json did nothing for me. Thanks!

Same issue here. I had to update the string.js file to be able to start the server.

Previously:

// my-ember-project/node_modules/ember-inflector/addon/lib/ext/string.js
if (Ember.ENV.EXTEND_PROTOTYPES === true || Ember.ENV.EXTEND_PROTOTYPES.String) {

Later:

// my-ember-project/node_modules/ember-inflector/addon/lib/ext/string.js
if (Ember.ENV.EXTEND_PROTOTYPES === true ||
    (typeof Ember.ENV.EXTEND_PROTOTYPES === 'object' &&
    Ember.ENV.EXTEND_PROTOTYPES.String)) {

Is there a better solution?