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

Unexpected token export declare #321

Open
Shana-AE opened this issue Sep 25, 2023 · 7 comments
Open

Unexpected token export declare #321

Shana-AE opened this issue Sep 25, 2023 · 7 comments
Labels
bug Something isn't working dts

Comments

@Shana-AE
Copy link

Shana-AE commented Sep 25, 2023

Environment

ubuild v2.0.0
node 18
typescript 5.2.2
vue3.3.4

Reproduction

build a project that import vue3.3.4 types

Describe the bug

when I build, I got
image
image

Additional context

No response

Logs

No response

@pi0
Copy link
Member

pi0 commented Sep 26, 2023

Please provide a reproduction 🙏🏼

@Shana-AE
Copy link
Author

Please provide a reproduction 🙏🏼

sorry, I lost my env and cannot reproduce. I'll keep an eye on this.

@wkeylin
Copy link

wkeylin commented Apr 13, 2024

@Shana-AE Please reopen, I have reproduced it @pi0 https://github.com/wkeylin/unbuild-demo

@pi0 pi0 reopened this Apr 15, 2024
@Bernankez
Copy link
Contributor

related #303
Can still be reproduced in [email protected]. The problem can be located here:

dts(ctx.options.rollup.dts),

If the dts plugin is moved before other plugins, it can run properly. But I'm not sure which plugin specifically conflicts with dts (@rollup/plugin-node-resolve or @rollup/plugin-commonjs)

@masterT
Copy link

masterT commented Apr 17, 2024

I'm having the same issue.

@pi0 pi0 added bug Something isn't working and removed needs reproduction labels Jun 4, 2024
@Eddie344
Copy link

I'm having the same issue.

@jan-tee
Copy link

jan-tee commented Dec 9, 2024

Is there any workaround at this point? I can repro by adding debug (to any project that otherwise compiles nicely with unbuild) to the dependencies and @types/debug to the devDependencies. Any export of this module's usage then causes the problem. Mere use (IOW, omitting the export {a}) does not.

import * as debug from "debug"

const a = debug.debug("horst");
export { a }

The offending line in @types/debug starts with declare var, the token that seems to cause the SyntaxError is var.

@pi0 pi0 added the dts label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dts
Projects
None yet
Development

No branches or pull requests

7 participants