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

[TypeScript] Error: Unexpected token #892

Closed
Jack-Works opened this issue Jun 1, 2021 · 8 comments
Closed

[TypeScript] Error: Unexpected token #892

Jack-Works opened this issue Jun 1, 2021 · 8 comments

Comments

@Jack-Works
Copy link

> npx rollup -c

Expected Behavior

Can compile

Actual Behavior

[!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)

Additional Information

related #287

@shellscape
Copy link
Collaborator

Duplicate of #287. Please comment on the other issue. If youd like to see it reopened/resolved pleade consider contributing.

@Jack-Works
Copy link
Author

Please comment on the other issue

It's locked and unresolved.

@Jack-Works
Copy link
Author

Oh is this resolved in #818?

@shellscape
Copy link
Collaborator

shellscape commented Jun 1, 2021

Thanks, I didn't realized it was locked. Yes, #818 was targeted to resolve most of the problems that caused the error. Given the size of the framework, we couldn't claim there aren't cases which it didn't resolve. That fix did land in https://github.com/rollup/plugins/blob/master/packages/typescript/CHANGELOG.md#v821. I'll reopen this as a separate issue, separate reproduction. It's worth noting that we're short on maintainers for the typescript plugin right now, and that this will likely need community contribution to be resolved.

@waynevanson
Copy link

I'll reopen this as a separate issue, separate reproduction.

Hi @shellscape, I'm looking to follow the trail but can't see the issue you've mentioned. If you've made it, what issue was it?

@stale
Copy link

stale bot commented Aug 8, 2021

Hey folks. This issue hasn't received any traction for 60 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it.

@stale stale bot closed this as completed Aug 8, 2021
@ZYinMD
Copy link

ZYinMD commented Sep 5, 2021

For those who still get this issue, fwiw, check if the parent directory or grand parent directory is a symlink. If yes, cd into the actual directory and try again.

@kibin
Copy link

kibin commented Mar 28, 2023

I had the same problem (plugin-typescript@11.0.0, rollup@3.20.2, node@18.15.0, typescript@4.9.5) and could only resolve it after extensive reading of original thread, especially this comment. thought I need to share my findings for others who struggle as well.
seems like outDir field is still a major offender for this plugin. code isn't compiling until it's removed from tsconfig.json.

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

No branches or pull requests

5 participants