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] mobx: Unexpected "@" #3485

Closed
mogiihu opened this issue Jun 25, 2021 · 1 comment
Closed

[BUG] mobx: Unexpected "@" #3485

mogiihu opened this issue Jun 25, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@mogiihu
Copy link

mogiihu commented Jun 25, 2021

Bug Report Quick Checklist

  • ✅ I am on the latest version of Snowpack & all plugins.(3.3.7)
  • ✅ I use package manager npm.
  • ✅ I run Snowpack on OS Mac.
  • ✅ I run Snowpack on Node.js v12+(v14.16.1)

Describe the bug

When I use mobx's decorator in the file, I get an error.

[16:34:25] [snowpack] Error: Transform failed with 1 error:
/project/react-snowpack3/src/pages/todoView/index.jsx:4:0: error: Unexpected "@"
[16:34:25] [@snowpack/plugin-esbuild] [500] /src/pages/todoView/index.js
A quick, clear, concise summary of what the bug is.

Expected behavior

Support for decorator.

@mogiihu mogiihu changed the title [BUG] [BUG] mobx: Unexpected "@" Jun 25, 2021
@drwpow drwpow added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Jun 25, 2021
@drwpow
Copy link
Collaborator

drwpow commented Jun 25, 2021

Hi @mogiihu. Decorators are currently a Stage 2 proposal which means they’re technically not JavaScript, which means you have to transform your JS in order to use them. By default, Snowpack does not support experimental JS features, because there are differing opinions on how they should be transformed (again, because it’s not yet implemented).

Two temporary workarounds for now are to either use TypeScript for decorators because of esbuild’s support, or use @snowpack/plugin-babel to load Babel plugins to transform decorators.

I’m going to close the issue because we won’t provide support for this, but please let me know if either of the workarounds are sufficient for you.

@drwpow drwpow closed this as completed Jun 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants