frolovdev/easymoney

not compiling in Ionic5/Angular8 app

zanuka opened this issue · 2 comments

Describe the bug
getting the following build error in an Ionic5 Angular project after installing easymoney

To Reproduce
Steps to reproduce the behavior:

  1. install easymoney
  2. ng run app:serve in Ionic/Angular project

The current behavior

app fails to build

> ng run app:serve --host=localhost --port=8100
[ng] ℹ 「wds」: Project is running at http://localhost:8100/webpack-dev-server/
[ng] ℹ 「wds」: webpack output is served from /
[ng] ℹ 「wds」: 404s will fallback to //index.html
[ng] chunk {main} main.js, main.js.map (main) 2.73 kB [initial] [rendered]
[ng] chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 155 kB [initial] [rendered]
[ng] chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
[ng] chunk {scripts} scripts.js, scripts.js.map (scripts) 3.85 kB [entry] [rendered]
[ng] chunk {styles} styles.js, styles.js.map (styles) 2.45 MB [initial] [rendered]
[ng] chunk {vendor} vendor.js, vendor.js.map (vendor) 340 kB [initial] [rendered]
[ng] Date: 2020-07-15T07:32:04.985Z - Hash: d5bdcc19c891350037ea - Time: 5889ms
[ng] 
[ng] ERROR in node_modules/@easymoney/core/dist/utils/assert.d.ts:1:74 - error TS1144: '{' or ';' expected.
[ng] 1 export declare function assert(condition: boolean, err?: Error): asserts condition;
[ng]                                                                            ~~~~~~~~~
[ng] 

Expected behavior
Expected to build normally

Additional Details
app core stack:

  • "@angular/core": "^8.2.9",
  • "@ionic-native/core": "^5.13.0",
  • node v12.6.1

Hi, thanks for the bug, it's not a problem with a library. Inside it uses asserts condition
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions

And such syntax works only from ts 3.7

I try to guess you use the older one. What version of typescript do you use? And could you try to upgrade it?

Also, my bad, it looks like I need to add some info to the docs about the supported typescript version (>3.7) or reimplement it to cover more range of versions instead of type safety.

Closed, now you can read requirements in https://github.com/frolovdev/easymoney#requirements