ERROR in node_modules/#angular/flex-layout/extended/typings/style/style.d.ts - html

I am getting an error as below on my Angular 6.0.8 application. I am using Angular CLI and running from VSCode.
ERROR in
node_modules/#angular/flex-layout/extended/typings/style/style.d.ts(72,67):
error TS1144: '{' or '; ' expected.
node_modules/#angular/flex-layout/extended/typings/style/style.d.ts(74,5): error TS1128: Declaration or stat ement expected.
node_modules/#angular/flex-layout/extended/typings/style/style.d.ts(74,33):
error TS1005: ';' expected.
node_modules/#angular/flex-layout/extended/typings/style/style.d.ts(74,39):
error TS1109: Expression expecte d.
node_modules/#angular/flex-layout/extended/typings/style/style.d.ts(79,5): error TS1128: Declaration or stat ement expected.
node_modules/#angular/flex-layout/extended/typings/style/style.d.ts(80,1): error TS1128: Declaration or stat ement expected.
Using the following version in application,
"#angular/flex-layout": "^6.0.0-beta.17",
"typescript": "~2.7.2"
"rxjs": "^6.2.1",
"#angular-devkit/build-angular": "~0.7.4",
"#angular/cli": "~6.0.8",
"#angular/compiler-cli": "^6.0.3",
Please help me to sort out this !!

Try upgrading typescript to 2.9.2 . Works for me with flex-layout 6.0.0-beta.18 and rxjs 6.3.2.
I think this is the Issue in flex-layout.

Revert to 6.2.2 version of RxJS to fix the build.
for further information please see: https://github.com/angular/flex-layout/issues/827

Related

Linting error after upgrading Angular 8 to 9

Got errors while running "npm run lint" command:
src/translations/en-US.json[1, 1]: unused expression, expected an assignment or function call
src/translations/en-US.json[2, 3]: " should be '
src/translations/en-US.json[13, 2]: Missing semicolon
Content of en-US.json:
{
"APP_NAME": "test-project",
"About": "About",
}
Tried applying few things in the tslint.json file will not resolving the same.
We can ignore linting rule for the translation files using the following command:
"ng lint --exclude \"src/translations/*.json\""
Thanks

I am getting following error when running ng serve

I'm new and I have a problem with VSCode. I am getting the following error when running ng serve:
PS C:\Windows\System32\x-app> ng serve --configuration=it
An unhandled exception occurred: Workspace config file cannot le loaded: C:\Windows\System32\x-app\angular.json
Invalid JSON character: "\"" at 73:7.
See "C:\Users\C-PROJ~1\AppData\Local\Temp\ng-LpcKJr\angular-errors.log" for further details
[error] Error: Workspace config file cannot le loaded: C:\Windows\System32\x-app\angular.json
Invalid JSON character: "\"" at 73:7.
at Object.getWorkspace (C:\Windows\System32\x-app\node_modules\#angular\cli\utilities\config.js:59:15)
at ServeCommand.validateScope (C:\Windows\System32\x-app\node_modules\#angular\cli\models\command.js:97:60)
at ServeCommand.validateAndRun (C:\Windows\System32\x-app\node_modules\#angular\cli\models\command.js:122:24)
at Object.runCommand (C:\Windows\System32\x-app\node_modules\#angular\cli\models\command-runner.js:185:38)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
I use prettier, in fa,ct I noticed that there was an oversight about internalization. I fixed the json file, and returned the command ng serve --configuration=it, but the result is another error.
PS C:\Windows\System32\x-app> ng serve --configuration=it
An unhandled exception occurred: Project does not exist.
See "C:\Users\C-PROJ~1\AppData\Local\Temp\ng-IomfPN\angular-errors.log" for further details.
[error] Error: Project does not exist.
at WorkspaceNodeModulesArchitectHost.findProjectTarget (C:\Windows\System32\x-app\node_modules\#angular-devkit\architect\node\node-modules-architect-host.js:94:23)
at WorkspaceNodeModulesArchitectHost.getOptionsForTarget (C:\Windows\System32\x-app\node_modules\#angular-devkit\architect\node\node-modules-architect-host.js:66:33)
at core_1.experimental.jobs.createJobHandler.target (C:\Windows\System32\x-app\node_modules\#angular-devkit\architect\src\architect.js:171:21)
at Observable.rxjs_1.Observable.subject [as _subscribe] (C:\Windows\System32\x-app\node_modules\#angular-devkit\core\src\experimental\jobs\create-job-handler.js:91:26)
at Observable._trySubscribe (C:\Windows\System32\x-app\node_modules\rxjs\internal\Observable.js:44:25)
at Observable.subscribe (C:\Windows\System32\x-app\node_modules\rxjs\internal\Observable.js:30:22)
at C:\Windows\System32\x-app\node_modules\rxjs\internal\util\subscribeTo.js:22:31
at Object.subscribeToResult (C:\Windows\System32\x-app\node_modules\rxjs\internal\util\subscribeToResult.js:10:45)
at SwitchMapSubscriber._innerSub (C:\Windows\System32\x-app\node_modules\rxjs\internal\operators\switchMap.js:65:54)
at SwitchMapSubscriber._next (C:\Windows\System32\x-app\node_modules\rxjs\internal\operators\switchMap.js:55:14)
at SwitchMapSubscriber.Subscriber.next (C:\Windows\System32\x-app\node_modules\rxjs\internal\Subscriber.js:66:18)
at SwitchMapSubscriber.notifyNext (C:\Windows\System32\x-app\node_modules\rxjs\internal\operators\switchMap.js:86:26)
at InnerSubscriber._next (C:\Windows\System32\x-app\node_modules\rxjs\internal\InnerSubscriber.js:28:21)
at InnerSubscriber.Subscriber.next (C:\Windows\System32\x-app\node_modules\rxjs\internal\Subscriber.js:66:18)
at MapSubscriber._next (C:\Windows\System32\x-app\node_modules\rxjs\internal\operators\map.js:55:26)
at MapSubscriber.Subscriber.next (C:\Windows\System32\x-app\node_modules\rxjs\internal\Subscriber.js:66:18)
your angular.json is probably malformed. please check if the file complies to the json standard. you may use tools like prettier to format the json.

Angular6 getting error when building site for production

I was using Angular: 6.0.3 and when I updated my angular using npm update I am getting error when I am trying to build site for production.
When I am running command:
ng build --prod
I am getting error:
ERROR in ./src/app/app.module.ngfactory.js Module build failed: TypeError: Cannot read property '_statSync' of undefined
Current angular version is: 6.1.10
Full error you can see it here:Full error report link
That error is because of the version of cache-loader in package.json file. just run npm update and you will get cache-loader 1.2.5 they have fixed this in updated version.

Gulp resolve failed

When I run my command:
gulp build
I get the error:
[13:28:52] Requiring external module babel-register
node_modules/nan
resolve failed for "caniuse-db": Error: Cannot find module 'caniuse-db'
resolve failed for "babel-runtime": Error: Cannot find module 'babel-runtime'
This seems to happen after I changed my preset in my .babelrc from es2015 to es2015-loose.
The stacktraces on this GitHub issue seem very similar to yours... They resolved the issue by switching from the es2015-loose preset to the es2015 preset with the loose option:
["es2015", { "loose": true }]

Unexpected error within json babel 6.9

Setting up babel cli and preset 2015. I am getting an unexepected error though
.babelrc: Error while parsing JSON - Unexpected 'e'
at JSON5.parse.error (/usr/local/lib/node_modules/babel-cli/node_modules/json5/lib/json5.js:50:25)
My babel file .bablelrc
for now is set up like
echo '{ "presets": ["es2015"] }' > .babelrc
My dev dependencies are set up like so
"devDependencies": {
"babel-cli": "^6.9.0",
"babel-preset-es2015": "^6.9.0"
}
not seeing the error in the babel rc file any insight would be much appreciated
I had the same error on Windows 7, I used PowerShell to put in the commands. Anyways the encoding for the index.js and .babelrc files were both something called UCS-2 BE BOM. So I changed the encoding for both files to UTF-8 and they both worked. Hopefully that helps.
It probably had something to do with invisible characters or whatever. Anyways in the future I'll probably avoid doing Linux-like commands on Windows.