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]Babel safe navigation operator invalid token #994

Closed
Sioweb opened this issue Aug 4, 2020 · 1 comment
Closed

[BUG]Babel safe navigation operator invalid token #994

Sioweb opened this issue Aug 4, 2020 · 1 comment
Labels
bug Something isn't working
Projects

Comments

@Sioweb
Copy link

Sioweb commented Aug 4, 2020

Describe the bug

Package @shopware-pwa is using the safe navigation operator or elvis operator, and this will throw an error in my new installation.

I've fixed this for me now with @babel/plugin-proposal-optional-chaining and @babel/plugin-proposal-nullish-coalescing-operator. webpack/webpack#10227 (comment)

yarn add @babel/plugin-proposal-optional-chaining @babel/plugin-proposal-nullish-coalescing-operator --save-dev

nuxt.config.json

build: {
    extend (config, ctx) {
    },
    babel: {
      plugins: [
        ["@babel/plugin-proposal-optional-chaining"],
        ["@babel/plugin-proposal-nullish-coalescing-operator"]
      ]
    }
  }

PS.: not sure if @babel/plugin-proposal-nullish-coalescing-operator is required for the solution.

Dont now if this is a good solution, but it works for me now.

Additional context

@Sioweb Sioweb added the bug Something isn't working label Aug 4, 2020
@mkucmus mkucmus added this to To do in Sprint #44 via automation Jan 22, 2021
@mkucmus mkucmus moved this from To do to In progress in Sprint #44 Jan 29, 2021
@mkucmus
Copy link
Collaborator

mkucmus commented Jan 29, 2021

the babel plugins listed above were added to the project by default, so the optional chaining is working even in vue components (except the secion).

@mkucmus mkucmus closed this as completed Jan 29, 2021
Sprint #44 automation moved this from In progress to Done Jan 29, 2021
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
No open projects
Development

No branches or pull requests

2 participants