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

[BUG] Typescript Import Attributes #987

Open
2 of 3 tasks
GODrums opened this issue Jun 1, 2024 · 1 comment
Open
2 of 3 tasks

[BUG] Typescript Import Attributes #987

GODrums opened this issue Jun 1, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@GODrums
Copy link

GODrums commented Jun 1, 2024

What happened?

Using Typescript's import attributes leads to build errors in Plasmo.

With Typescript 5.3, import attributes have been introduced: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-3.html

🟣 Plasmo v0.86.3
🔴 The Browser Extension Framework
🔵 INFO   | Starting the extension development server...
🔵 INFO   | Loaded environment variables from: [ '.env.chrome', '.env' ]
🔴 ERROR  | Build failed. To debug, run plasmo dev --verbose.
🔴 ERROR  | Expected ';', got 'with'

or with plasmo dev --verbose

🔵 INFO   | Loaded environment variables from: [ '.env.chrome', '.env' ]
🟡 0      | @plasmohq/parcel-transformer-manifest
🟡 1      | Adding tab onboarding.tsx
🟡 2      | Adding icons
🟡 3      | Adding default_icon
🟡 4      | Adding default_popup
🟡 5      | Handling MV3 background service worker
🟡 6      | + Finished transforming manifest
🔴 ERROR  | Expected ';', got 'with'
🟡 30     | ...\src\lib\handlers\mappinghandler.ts:1:45

with the corresponding line mappinghandler.ts:1:45:
import buffIds from '@/assets/buffids.json' with { type: "json" };

My package.json uses "typescript": "5.4.5".

Version

Latest

What OS are you seeing the problem on?

Windows

What browsers are you seeing the problem on?

No response

Relevant log output

No response

(OPTIONAL) Contribution

  • I would like to fix this BUG via a PR

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I checked the current issues for duplicate problems.
@GODrums GODrums added the bug Something isn't working label Jun 1, 2024
@louisgv
Copy link
Contributor

louisgv commented Jun 10, 2024

I think the packaged Parcel's TS path resolver doesn't support TS import attributes atm xd...

If you can help with #813 that'd be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants