Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Angular] Codegen compilation error (rxjs 6.4.0) #9135

Closed
dotmobo opened this issue Jan 30, 2019 · 2 comments
Closed

[Angular] Codegen compilation error (rxjs 6.4.0) #9135

dotmobo opened this issue Jan 30, 2019 · 2 comments

Comments

@dotmobo
Copy link

dotmobo commented Jan 30, 2019

Hi, we have the following error because the new version of rxjs 6.4.0 needs typescript > 2.8 to work, so the ng-package.json generated is currently wrong. Thank you for your help ! :

ng-packagr -p ng-package.json

Building Angular Package
Building entry point '@myproject/myapp'
Cleaning build directory
Rendering Stylesheets
Rendering Templates
Compiling TypeScript sources through ngc

BUILD ERROR
node_modules/rxjs/internal/types.d.ts(81,44): error TS1005: ';' expected.
node_modules/rxjs/internal/types.d.ts(81,74): error TS1005: ';' expected.
node_modules/rxjs/internal/types.d.ts(81,77): error TS1109: Expression expected.

Error: node_modules/rxjs/internal/types.d.ts(81,44): error TS1005: ';' expected.
node_modules/rxjs/internal/types.d.ts(81,74): error TS1005: ';' expected.
node_modules/rxjs/internal/types.d.ts(81,77): error TS1109: Expression expected.
@dotmobo dotmobo changed the title [Angular] Codegen compilation error [Angular] Codegen compilation error (rxjs 6.4.0) Jan 31, 2019
@dotmobo
Copy link
Author

dotmobo commented Jan 31, 2019

see the following issue, it seems linked : ReactiveX/rxjs#4512

@rcalandr
Copy link

rcalandr commented Feb 13, 2019

Don't know if this can help someone, but as a workaround we defined a (gradle) task for api generation and inside that task we did something like this as a doLast

outputs.getFiles().forEach{ f-> 
f.eachFile(FileType.FILES) { file ->
                                if (file.name == 'package.json'){
                                    def packageJson = new JsonSlurper().parseText(file.getText('UTF-8'))
                                    def builder = new JsonBuilder(packageJson)
                                    builder.content.peerDependencies.rxjs = packageJson.peerDependencies.rxjs.replace('^','')
                                    builder.content.devDependencies.rxjs = packageJson.devDependencies.rxjs.replace('^','')
                                    file.write(builder.toPrettyString(), 'UTF-8')
                                }
                            }
					}

To avoid the use of rxjs 6.4.0 until the related issue is open. As a side note, this is affecting also openapi-generator

@dotmobo dotmobo closed this as completed Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants