Skip to content
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

Ember.ENV.EXTEND_PROTOTYPES - Cannot read property 'String' of undefined #145

Open
pavlo opened this issue Apr 23, 2018 · 4 comments
Open

Comments

@pavlo
Copy link

pavlo commented Apr 23, 2018

Hey, after a recent update to the app I am receiving the following error: Cannot read property 'String' of undefined. I traced it down to a condition in the inflector's addon/lib/ext/string.js:

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

My environment does not have EXTEND_PROTOTYPES in it. It has the following, literally:

EmberENV: {
    FEATURES: {
        // Here you can enable experimental features on an ember canary build
        // e.g. 'with-controller': true
    }
 }

What's the most odd here is that all the dependency versions are specific in bower.json, there're no ~ nor ^:

{
    "name": "frontend",
    "dependencies": {
        "ember": "2.6.0",
        "ember-cli-shims": "0.1.1",
        "ember-cli-test-loader": "0.2.2",
        "ember-qunit-notifications": "0.1.0",
        "bootstrap": "3.3.5",
        "pretender": "1.1.0",
        "Faker": "3.1.0",
        "jsoneditor": "5.5.6",
        "jquery-jsonview": "1.2.3",
        "pace": "1.0.2"
     }
}

as well as in package.json:

"devDependencies": {
    "broccoli-asset-rev": "2.4.2",
    "ember-ajax": "2.0.1",
    "ember-bootstrap": "0.7.3",
    "ember-cli": "2.6.2",
    "ember-cli-app-version": "1.0.0",
    "ember-cli-babel": "5.1.6",
    "ember-cli-dependency-checker": "1.2.0",
    "ember-cli-events-bus": "0.0.2",
    "ember-cli-htmlbars": "1.0.3",
    "ember-cli-htmlbars-inline-precompile": "0.3.1",
    "ember-cli-inject-live-reload": "1.4.0",
    "ember-cli-jshint": "1.0.0",
    "ember-cli-moment-shim": "2.0.0",
    "ember-cli-notifications": "3.3.1",
    "ember-cli-pace": "0.1.0",
    "ember-cli-pagination": "2.2.2",
    "ember-cli-qunit": "1.4.0",
    "ember-cli-release": "0.2.9",
    "ember-cli-sri": "2.1.0",
    "ember-cli-sticky": "0.6.1",
    "ember-cli-uglify": "1.2.0",
    "ember-data": "2.14.2",
    "ember-export-application-global": "1.0.5",
    "ember-json-editor-for": "1.1.3",
    "ember-load-initializers": "0.5.1",
    "ember-moment": "7.0.0-beta.3",
    "ember-resolver": "2.0.3",
    "ember-welcome-page": "1.0.1",
    "loader.js": "4.0.1",
    "ember-cp-validations": "3.3.2"
}

so I did not expect that a regular update would break the app! :(

Could you please help me out sorting the particular issue as well as share a link to a resource to help figuring out how to "freeze" the dependencies reliable so it is not that fragile all of the sudden?

Thank you!

@GaltMidas
Copy link

Anybody find a workaround for this?

@pavlo
Copy link
Author

pavlo commented May 1, 2018

@GaltMidas, I had to set 2.2.0 version in package.json explicitly since the bug(?) was introduced in 2.3.0 I guess. So the following helped:

"ember-inflector": "2.2.0"

Let me know if this helps you out.

@GarPit
Copy link

GarPit commented May 11, 2018

The same issue for me

@sandstrom
Copy link
Contributor

sandstrom commented Dec 3, 2020

@pavlo Can you try with 4.0.0 (https://github.com/emberjs/ember-inflector/blob/master/CHANGELOG.md). I'm pretty sure this is no longer an issue.

Or just feel free to close this issue. We can re-open if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants