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

tsx generator syntax error #1299

Closed
bichikim opened this issue Dec 29, 2020 · 1 comment · Fixed by #1368
Closed

tsx generator syntax error #1299

bichikim opened this issue Dec 29, 2020 · 1 comment · Fixed by #1368
Assignees
Labels
Milestone

Comments

@bichikim
Copy link

The generator function is not a jsx element

error: Expected (, got < (jsx tag start)

image

Input code

export const iteratorMapGenerator = function *<T, R>(
  values: IterableIterator<T>,
  execute: IteratorExecution<T, R>,
): IterableIterator<R> { 
//...
 }

Config

module.exports = {
             jsc: {
            parser: {
              decorators: true,
              dynamicImport: true,
              syntax: 'typescript',
              // function *<X> (){} parsing error
              tsx: true,
            },
            target: 'es2017',
          },
          sourceMaps: true,

Expected behavior
A clear and concise description of what you expected to happen.
The SWC should compile it same as Babel

Version
The version of @swc/core: 1.1.43

Additional context
Add any other context about the problem here.

@bichikim bichikim added the C-bug label Dec 29, 2020
@kdy1 kdy1 added this to the v1.2.47 milestone Jan 25, 2021
@kdy1 kdy1 self-assigned this Jan 29, 2021
kdy1 added a commit to kdy1/swc that referenced this issue Jan 29, 2021
kdy1 added a commit to kdy1/swc that referenced this issue Jan 29, 2021
kdy1 added a commit to kdy1/swc that referenced this issue Jan 29, 2021
kdy1 added a commit to kdy1/swc that referenced this issue Jan 29, 2021
kdy1 added a commit that referenced this issue Jan 29, 2021
swc_ecma_parser:
 - Fix generic parsing issue in jsx context. (#1299)

swc_ecma_transforms_module:
 - Allow importing a module multiple time. (#1232)
 - Handle imports in the constructor of an exported class decl. (#1213)

swc:
 - Respect `sourceMappingURL`. (#1236)
 - Resolve `sourceMappingURL` relative from file. (#1255)
 - Respect `isModule: false` (#1258)

spack:
 - Support loading json files. (#1225)
@swc-bot
Copy link
Collaborator

swc-bot commented Oct 25, 2022

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Oct 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

3 participants