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

wrong declarations - Initializers are not allowed in ambient contexts. #188

Closed
maciejw opened this issue Dec 10, 2018 · 11 comments
Closed
Labels

Comments

@maciejw
Copy link

maciejw commented Dec 10, 2018

due to error in typescript 3.1 microsoft/TypeScript#28230

there is an error in your d.ts files

node_modules/fork-ts-checker-webpack-plugin/lib/index.d.ts:37:44 - error TS1039: Initializers are not allowed in ambient contexts.

37     static readonly DEFAULT_MEMORY_LIMIT = 2048;
                                              ~~~~

when I fixed typescript version to 3.0.3 in your project, declarations are correct.

now in package.json you have ^3.0.1 and 3.1.6 in yarn.lock it has to be changes to 3.0.3

3.2.2 can't compile due to

src/IncrementalChecker.ts:250:43 - error TS2345: Argument of type 'ReadonlyArray<Diagnostic>' is not assignable to parameter of type 'Diagnostic[]'.
  Type 'ReadonlyArray<Diagnostic>' is missing the following properties from type 'Diagnostic[]': pop, push, reverse, shift, and 6 more.

250       diagnostics.push.apply(diagnostics, diagnosticsToRegister);
                                              ~~~~~~~~~~~~~~~~~~~~~


Found 1 error.
@johnnyreilly
Copy link
Member

Presumably this only impacts users who make use of the .d.ts files?

We won't be locking the plugin to a older version of TypeScript. If you'd like to submit a PR that remedies this in another way that would be great!

@johnnyreilly
Copy link
Member

3.2.2 can't compile due to

Should be fixed by #189 hopefully.

@maciejw
Copy link
Author

maciejw commented Dec 10, 2018

damn you were faster :) maybe next time I'll win this PR race ;)

@johnnyreilly
Copy link
Member

Published as https://github.com/Realytics/fork-ts-checker-webpack-plugin/releases/tag/v0.5.1

Though I'm guessing the .d.ts error may remain? It still could be your time to shine!

@CRodriguez25
Copy link

I'm actually getting this same error. The docs say that typescript 2.1 is the minimum working version of Typescript, and I'm using 2.8. Is that accurate?

@johnnyreilly
Copy link
Member

Yes

@CRodriguez25
Copy link

Any idea why I'd be seeing this error then? I'm unable to use this tool at all unless I upgrade to something like Typescript 3.1.1, but unfortunately that breaks some other stuff. I'd love to be able to use it.

@johnnyreilly
Copy link
Member

Do you need to write your webpack.config.js in TypeScript? As I understand it, it's just that that's hindering you?

@piotr-oles piotr-oles added the bug label May 19, 2019
@oozliuoo
Copy link

oozliuoo commented Jul 7, 2019

Any updates on this issue? We are using the .d.ts file and this error still remains. Should we submit PR to this repo to fix it??

@johnnyreilly
Copy link
Member

Sure!

@piotr-oles piotr-oles mentioned this issue Apr 18, 2020
26 tasks
@piotr-oles
Copy link
Collaborator

@maciejw , @oozliuoo
Please try fork-ts-checker-webpack-plugin@alpha - I've published a new version which should resolve this issue 🚀
I will close this issue to clean-up the backlog. If this release didn't solve the issue, we can re-open this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants