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

Unknown compiler option 'jsxFragmentFactory' #711

Open
TechQuery opened this issue Aug 28, 2020 · 5 comments
Open

Unknown compiler option 'jsxFragmentFactory' #711

TechQuery opened this issue Aug 28, 2020 · 5 comments

Comments

@TechQuery
Copy link

@TechQuery TechQuery commented Aug 28, 2020

I guess MicroBundle hasn't support TypeScript 4.x, because I got an error:

rpt2: config error TS5023: Unknown compiler option 'jsxFragmentFactory'.

@wardpeet
Copy link
Collaborator

@wardpeet wardpeet commented Aug 28, 2020

Thanks will look into it 👍

Could you create a small comment on how to reproduce this? Or do you have a repo?

@TechQuery
Copy link
Author

@TechQuery TechQuery commented Aug 29, 2020

Just add an option "jsxFragmentFactory": "Fragment" in your tsconfig.json, and then run microbundle again, you'll see the error.

Here is the offical document: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#custom-jsx-factories

@developit
Copy link
Owner

@developit developit commented Sep 8, 2020

We should check TS version and use the appropriate config - it would be a shame to have Microbundle only work with TS 4.

@whitetrefoil
Copy link

@whitetrefoil whitetrefoil commented Oct 15, 2020

Not only tsconfig.json options but also code syntax will have the same ts version problem.

In my case:

try {
  something()
} catch (e: unknown) {
         ^ (rpt2 plugin) Error: semantic error TS1196: Catch clause variable cannot have a type annotation.
  something()
}

Where here (e: unknown) is new syntax in TS 4.0, it's recommanded (safer) and checked by ESLint.

Maybe microbundle can try locally installed ts first before using rpt2's default one. Or at least some way to set the version manually.

@developit
Copy link
Owner

@developit developit commented Nov 5, 2020

Thanks for the idea and PR @whitetrefoil - good thinking.

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

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.