import {TranslateModule, TranslateLoader} from '@ngx-translate/core';
import {TranslateHttpLoader} from '@ngx-translate/http-loader';
export function httpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http, "assets/i18n/", ".json");
}
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: httpLoaderFactory,
deps: [HttpClient]
}
})
When executing npm build --prod we get the following errors:
ERROR in ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve '@ngx-translate/core/index' in 'C:\Projects\process-mgt\src\app'
ERROR in ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve '@ngx-translate/core/src/missing-translation-handler' in 'C:\Projects\process-mgt\src\app'
ERROR in ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve '@ngx-translate/core/src/translate.compiler' in 'C:\Projects\process-mgt\src\app'
ERROR in ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve '@ngx-translate/core/src/translate.loader' in 'C:\Projects\process-mgt\src\app'
ERROR in ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve '@ngx-translate/core/src/translate.parser' in 'C:\Projects\process-mgt\src\app'
ERROR in ./src/app/app.component.ngfactory.js
Module not found: Error: Can't resolve '@ngx-translate/core/src/translate.pipe' in 'C:\Projects\process-mgt\src\app'
ERROR in ./src/app/app.component.ngfactory.js
Module not found: Error: Can't resolve '@ngx-translate/core/src/translate.service' in 'C:\Projects\process-mgt\src\app'
ERROR in ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve '@ngx-translate/core/src/translate.service' in 'C:\Projects\process-mgt\src\app'
ERROR in ./src/app/app.module.ngfactory.js
Module not found: Error: Can't resolve '@ngx-translate/core/src/translate.store' in 'C:\Projects\process-mgt\src\app'
When we run npm build --prod --aot=false --buildOptimizer=false we don't get this error.
Expected behavior
How do you think that we should fix this?
Minimal reproduction of the problem with instructions
Environment
Angular 7.2.4
"@ngx-translate/core": "^10.0.1",
"@ngx-translate/http-loader": "^2.0.1",
```
We did check with several versions.
Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
For Tooling issues:
- Node version: XX
- Platform:
Others:
Current behavior
We use NGX-translate as follows:
When executing npm build --prod we get the following errors:
When we run npm build --prod --aot=false --buildOptimizer=false we don't get this error.
Expected behavior
How do you think that we should fix this?
Minimal reproduction of the problem with instructions
Environment