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

Can't parse JS modules exported from index files in TS project #295

Open
bromanazzi opened this issue Nov 1, 2024 · 0 comments
Open

Can't parse JS modules exported from index files in TS project #295

bromanazzi opened this issue Nov 1, 2024 · 0 comments
Assignees
Labels
status: waiting for maintainer These issues haven't been looked at yet by a maintainer typescript

Comments

@bromanazzi
Copy link

bromanazzi commented Nov 1, 2024

Steps to reproduce

https://codesandbox.io/p/github/bromanazzi/pigment-test/main

  1. Open the preview

Current behavior

Shows the error Unexpected token, expected: ","

However, if you go to App.tsx and change the Button import to the component file (./Button/Button) it works normally.

Expected behavior

It should render the button normally

Context

We're trying to add pigment to a large project with both js and ts. On starting our server with the pigment plugin active, vite throws this kind of error for hundreds of .jsx files.
It seems like it's trying to parse the files as ts. On empty fragments <> for example, it says that Type parameter list cannot be empty.

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: typescript modules export transform parse

@bromanazzi bromanazzi added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for maintainer These issues haven't been looked at yet by a maintainer typescript
Projects
None yet
Development

No branches or pull requests

3 participants