Angular 13 Cannot find module '#angular/common/locales - locale

I am updating to Angular 13 and I am seeing errors surrounding this import:
import(`#angular/common/locales/${lang.split('-')[0]}.js`).then(locale => {
registerLocaleData(locale.default); });
What should I be using?

Recently, I have migrated to Angular 13. I also faced the same issue. The changes below worked for me.
import(`#/../#angular/common/locales/${lang}.mjs`)
.then(localModule => {
registerLocaleData(localModule.default)
});

Related

Metro Has Encountered an error: Cannot read properties of undefined(reading 'transformfile'). ERROR

Not sure Why I am getting this issue. I am following a react-native tutorial, and am experiencing this error:
TransformFile(filePath, transformOptions) {
var _this3 = this;
return _asyncToGenerator(function*() {
// We need to be sure that the DependencyGraph has been initialized.
// TODO: Remove this ugly hack!
yield _this3._depGraphPromise;
return _this3._transformer.transformFile(filePath, transformOptions);
})();
This problem usually happens because the user is using a node version thats newer. You can solve this by downgrading your node using Nvm. Here is the Link to Using Nvm, https://www.npmjs.com/package/nvm. Let me know if you have any further questions :)

server.on is not a function when migrating from hapi 16 to 17

I'm trying to migrate my nodejs code using hapi 16.1.1 to 17.7.0 (the upgrade in hapi dependency is motivated by vulnerability raised by npm audit).
The following code works in 16.1.1:
server = new hapi.Server();
server.on('log', function (event, tags) {
...
});
However, with 17.7.0 I'm getting the following error:
TypeError: server.on is not a function
I guess that old server.on() should have some equivalente in hapi 17, but I haven't find migration documentation from v16 to v17.
Any help on how to solve this will be highly appreciated. Thanks!
Thanks to Kevin B suggestion (thanks!) I have changed the code this way:
server.events.on('log', function (event, tags) {
...
}
and it works.

node.js | BAD_REQUEST error suddenly appeared

I use node.js with the google-translate-api package.
It all worked fine for months but suddenly and I can't tell why, the simple code
translate("hello", {from: "en", to: "fr"}).then(res => {
console.log(res.text);
}).catch(err => console.log(err));
stopped working and I get this error everytime now :
Error at C:\Users\...\AutoTranslate\node_modules\google-translate-api\index.js:105:17 at at process._tickCallback (internal/process/next_tick.js:188:7) code: 'BAD_REQUEST'
Therefore it is not due to my code but probably to some parameters of node but I don't know. From now on, other packages which use async calls crash with the same error.
I even tried to uninstall node and reinstall it but I can't make it to work again.
Thanks!
Your Ip has been blocked so try to connect with other network it will work fine

Module did not self register with Talib and AVA

I'm getting a Module did not self register error I am unable to get rid of using talib and ava.
I have tried Node 8.9.0 as well as 9.0.0, upgraded AVA and tried stable and dev branches of talib. I am running test serially as well. And of course I have cleared and rebuilt my node_modules folder - this is evidently not a case of changing node versions like I have seen posted.
Test:
test.serial( t => {
const talib = require('talib')
})
test.serial( t => {
const talib = require('talib')
})
The first test works but more than one throws that error. In the past I have had success clearing modules with clear-module and import-fresh but not this time.
const clear = require('clear-module')
const fresh = require('import-fresh')
test.serial(t => {
clear.all('talib')
const talib = fresh('talib')
})
I don't know where that error comes from, but one thing to keep in mind is that AVA starts running your tests asynchronously, e.g. not when the file is first loaded. Do you need to require talib outside of test.serial()?

Deploying angular 2 app Aot with Rollup and external dependencies

I've implemented an angular 2 app which utilize Kendo UI Grid:
I am stuck when deploying app with AoT + Rollup:
Error: 'GridModule' is not exported by node_modules\#progress\kendo-angular-grid\dist\npm\js\main.js (imported by app\app.module.js).
Tried this from Rollup documentation but I don't understand how to configure namedExports:
commonjs({
namedExports: {
'node_modules/#progress/kendo-angular-grid/dist/npm/js/main.js': [ 'GridModule' ]
}
});
Using above configuration doesn't solve the problem.
EDIT:
finally my working configuration for grid is:
namedExports: {
'#progress/kendo-angular-grid': ['GridModule'],
'#progress/kendo-angular-intl/dist/npm/js/intl.service': ['IntlService'],
'#progress/kendo-angular-intl/dist/npm/js/cldr-intl.service': ['CldrIntlService'],
'#progress/kendo-angular-grid/dist/npm/js/grid.module': ['GridModule'],
'#progress/kendo-angular-grid/dist/npm/js/shared.module': ['SharedModule'],
'#progress/kendo-angular-grid/dist/npm/js/grid.component': ['GridComponent', 'DEFAULT_SCROLLER_FACTORY'],
'#progress/kendo-angular-grid/dist/npm/js/browser-support.service': ['BrowserSupportService'],
'#progress/kendo-angular-grid/dist/npm/js/selection.service': ['SelectionService'],
'#progress/kendo-angular-grid/dist/npm/js/details.service': ['DetailsService'],
'#progress/kendo-angular-grid/dist/npm/js/column.component': ['ColumnComponent'],
'#progress/kendo-angular-grid/dist/npm/js/header-template.directive': ['HeaderTemplateDirective'],
'#progress/kendo-angular-grid/dist/npm/js/col-group.component': ['ColGroupComponent'],
'#progress/kendo-angular-grid/dist/npm/js/cell-template.directive': ['CellTemplateDirective'],
'#progress/kendo-angular-grid/dist/npm/js/header.component': ['HeaderComponent'],
'#progress/kendo-angular-grid/dist/npm/js/resizable.directive': ['ResizableContainerDirective'],
'#progress/kendo-angular-grid/dist/npm/js/list.component': ['ListComponent'],
'#progress/kendo-angular-grid/dist/npm/js/pager.component.js': ['PagerComponent'],
'#progress/kendo-angular-grid/dist/npm/js/template-context.directive': ['TemplateContextDirective'],
'#progress/kendo-angular-grid/dist/npm/js/footer.component': ['FooterComponent'],
'#progress/kendo-angular-grid/dist/npm/js/selectable.directive': ['SelectableDirective'],
'#progress/kendo-angular-grid/dist/npm/js/table-body.component': ['TableBodyComponent'],
'#progress/kendo-angular-grid/dist/npm/js/field-accessor.pipe': ['FieldAccessorPipe'],
'#progress/kendo-angular-grid/dist/npm/js/list.component': ['ListComponent', 'SCROLLER_FACTORY_TOKEN','DEFAULT_SCROLLER_FACTORY']
}
It doesn't work if 'include' section is enabled
Update (Dec 7, 2016): All packages are updated to export ES2015 module bundles, so integration with Rollup should work out of the box.
Nov 7, 2016: At the time of writing, the NPM packages of Kendo UI for Angular do not provide module entry points (that use imports/export), which are required for Rollup to work automatically. We plan on introducing them in the future; until they are in place, this problem can be resolved via namedExports.
See the related GitHub issue

Resources