-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
TypeError: Attempted to assign to readonly property. on Safari 6 (Mac) #392
Comments
It's happening to me too. It is only happening in Safari 6. No problems in Safari 5.x or Chrome. I'm using 2.0.2 |
At least on my configuration, I have narrowed it down to the i18n plugin. When I remove all i18n! imports it loads fine. |
Hi... same problem here... also seems to be in i18n plugin.... |
Here's the eventual load timeout error I get (my translations are in a file called 'strings.js'): |
Hmm, yes, something is up, it appears that when in 'use strict' mode, Safari 6 does not like it if I add a property to a string value. Other strict aware browsers allow the assignment but apparently give I'm investigating a fix, but in the meantime, if you are stuck, open up the require.js file and remove the 'use strict'; line near the top of the code. |
…d r.js removes strict statements anyway by default. More consistent behavior now.
Fixed in master, just removed strict, for reasons, see commit above: |
There is always "side effect" on my code :(
require([ And when i try to access to Backbone I get "ReferenceError: Can't find variable: Backbone" (only on safari 6).... I will investigate today but others navs are ok :( |
@shoork do you get that error with the latest master require.js that has a fix for the original issue in this ticket? https://raw.github.com/jrburke/requirejs/master/require.js If you try the latest master that should perform better if it is caused by the same underlying issue. |
no I just make the fix "removing strict"... i'll test with lastest master this afternoon (in a few hours) to see if it solve the problem |
@shoork OK. If you still see the issue, then I suggest opening a new ticket, since it will likely be a different fix, and I will want to track the fix separately from this one. |
Hi James, Same problem here. I'm using the r.js optimiser to include two locales in a build. When loading the non-root locale in the optimised scenario, the error above occurs in Safari 6 (and on iPhone). Removing the "use strict" line does indeed fix the problem. A minimal implementation in order to reproduce this bug can be found at: https://github.com/marcokrikke/requirejs-strict-mode-error Steps to reproduce:
|
@marcokrikke see one of my previous comments to a link to the requirejs master version that fixes the problem. That fix will be in a 2.0.5 release. |
@jrburke yup, already found that one, thanks. |
See: #196 and: requirejs/requirejs#392 updates #196
plugin.load(map.name, makeRequire(map.parentMap, true, function (deps, cb) {
deps.rjsSkipMap = true;
return context.require(deps, cb);
}), load, config);
At line deps.rjsSkipMap = true; it returns an error "TypeError: Attempted to assign to readonly property." and stops the load of the modules.
The text was updated successfully, but these errors were encountered: