Erorr: f is not a function
See original GitHub issueAfter I upgraded to 0.8.6 from 0.8.3 I started getting the error “” in one of my mocha tests. I stepped in with the debugger and i noticed that f
get’s compiled as an object and not as a function in i18n.__ = function i18nTranslate(phrase) {
.
This particular key is an object, which in the past I was able to translate as an object and iterate over the translated strings.
"roles": {
"role1": "role1 name",
"role2": "role2 name"
}
My setup does enable object notation:
i18n.configure({
directory: `${__dirname}/../../shared/locales`,
objectNotation: true,
updateFiles: false,
defaultLocale: 'en',
api: {
__mf: 'translate',
getLocale: 'locale'
}
});
Is there a breaking change I am missing?
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Why "TypeError: f is not a function"? - Stack Overflow
It calls the just-declared function, which then calls f , but f has not been initialized yet and thus is not a function....
Read more >TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >How to Handle JavaScript Uncaught TypeError: “x” is Not a ...
The Javascript error TypeError: "x" is not a function occurs when there is an attempt to call a function on a value or...
Read more >Uncaught TypeError: f is not a function · Issue #1 - GitHub
fromFSAtoCCA, i get the error as described in the title. This does not seem to fix the problem after upgrading to redux 3.0.0....
Read more >How to solve the "is not a function" error in JavaScript
It consider require('fs') as the name of the function, which is something that could actually work if the module export returned a function....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There has been a major version upgrade on messageformat in release 0.8.4 which also required a compatibility setting to keep passing my tests:
to be honest I can’t tell wether the older messageformat compiled to functions or objects as I never tested on types but on results (https://github.com/mashpie/i18n-node/blob/master/test/i18n.mf.js)
well… this is good news. Could be that any of an
npm update
oryarn update
is failing pulling newest version. A common solution is to cleanUp node_modules and/oryarn cache clean