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

Error with angular 8.2.14 when ng serve #266

Closed
1 task done
xavierclotet opened this issue Apr 14, 2020 · 10 comments
Closed
1 task done

Error with angular 8.2.14 when ng serve #266

xavierclotet opened this issue Apr 14, 2020 · 10 comments

Comments

@xavierclotet
Copy link

I'm submitting a...


[X] Regression (a behavior that used to work and stopped working in a new release)

Current behavior

When I do ng serve i get this error:

ERROR in ../node_modules/@ngneat/transloco/lib/transloco.service.d.ts:33:9 - error TS1086: An accessor cannot be declared in an ambient context.

33 get config(): TranslocoConfig;

Expected behavior

No error, supporting angular 8 ? Typescript 3.5.3

Environment

"@angular/core": "~8.2.14",
"@ngneat/transloco": "^2.14.0",
"@ngneat/transloco-locale": "^1.1.1",
"@ngneat/transloco-persist-lang": "^1.0.2",
"@ngneat/transloco-persist-translations": "^1.0.0",
"typescript": "3.5.3"

Browser:

  • Chrome (desktop) version XX

For Tooling issues:

  • Node version: 12.16.1
  • Platform: Linux
@ciprian-iacob
Copy link

I have a similar issue. What was the fix in your case?

@xavierclotet
Copy link
Author

fix the transloco versions without ^ ie:

"@ngneat/transloco": "2.14.0",
"@ngneat/transloco-locale": "1.1.1",
"@ngneat/transloco-persist-lang": "1.0.2",
"@ngneat/transloco-persist-translations": "1.0.0",

@ciprian-iacob
Copy link

Thanks for sharing it. It looks like there's an issue with version 2.14.1 of transloco that forces the apps to upgrade the angular cli and typescript version latest version. From what I understand there is some breaking change in typescript that causes it.
Similar issues were described in storybook repo: storybookjs/storybook#9463

@shaharkazaz
Copy link
Collaborator

shaharkazaz commented Apr 14, 2020

@ciprian-iacob you are correct, I'm reverting back the TS version and I'll release it in v2.14.2.
Can you test after I release and LMK if it's ok?

@ciprian-iacob
Copy link

@shaharkazaz Yes, sure.

@shaharkazaz
Copy link
Collaborator

@ciprian-iacob should be up, can you verify? 🙂

@ciprian-iacob
Copy link

@shaharkazaz I can confirm that v2.14.2 is working fine in my testing and the issue describe above is no longer reproducible. Thank you for the fast response and quick fix. Keep up the good work.

@xavierclotet
Copy link
Author

Thx @shaharkazaz

@kabomi
Copy link

kabomi commented Apr 17, 2020

Now with v2.14.2, angular 6 & 7 they both fail. I had to downgrade to v2.14.0

ngneat-transloco.js:816 Uncaught TypeError: Object(...) is not a function
at ngneat-transloco.js:816
at Module../node_modules/@ngneat/transloco/fesm5/ngneat-transloco.js (ngneat-transloco.js:828)
at webpack_require (bootstrap:78)

TranslocoService.ɵprov = ɵɵdefineInjectable({ factory: function TranslocoService_Factory() { return new TranslocoService(ɵɵinject(TRANSLOCO_LOADER, 8), ɵɵinject(TRANSLOCO_TRANSPILER), ɵɵinject(TRANSLOCO_MISSING_HANDLER), ɵɵinject(TRANSLOCO_INTERCEPTOR), ɵɵinject(TRANSLOCO_CONFIG), ɵɵinject(TRANSLOCO_FALLBACK_STRATEGY)); }, token: TranslocoService, providedIn: "root" });

I think transloco needs a new major version or a README update with breaking changes

@itayod
Copy link
Contributor

itayod commented Apr 18, 2020

Hi @kabomi it seems like you are right. Apparently Angular's View Engine compiler in V9 does not support Angular versions lower than 8 even though they say it is.
We will update the BREAKING_CHANGES file to include that information.

Thanks for letting us know!

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

5 participants