Skip to content
This repository was archived by the owner on May 14, 2021. It is now read-only.

exportDefaultFrom error from parser after upgrade to 1.4.0 #228

Closed
thmsobrmlr opened this issue Oct 1, 2018 · 8 comments
Closed

exportDefaultFrom error from parser after upgrade to 1.4.0 #228

thmsobrmlr opened this issue Oct 1, 2018 · 8 comments

Comments

@thmsobrmlr
Copy link

I'm currently in the process of updating from version 1.3.2 to 1.4.0. As I can see from the changelog, babel errors are now shown to users. I'm now getting a few of those:

This experimental syntax requires enabling the parser plugin: 'exportDefaultFrom' (1:7)

The files where this occurs are very simple e.g.:

export Container from './Container';

How can I configure the parser used by this plugin to allow for the experimental syntax? Am I doing something wrong?

@chinesedfan
Copy link
Member

@Thomas88 #229 should provide a way to config babel. You can try it locally and I will publish later.

@chinesedfan
Copy link
Member

v1.5.0 has been published.

@thmsobrmlr
Copy link
Author

Awesome, thanks for the quick fix @chinesedfan! I've now added exportDefaultFrom to the default plugins and it works again.

A question from my side: I think it would be better if the plugin could simply use the same configuration as I use for babel i.e. .babelrc / babel prop in package.json. Does this not work? Do you think this is a bad idea?

@chinesedfan
Copy link
Member

@Thomas88 Good idea. I created #231 to remind later developers.

@rtymchyk
Copy link

I am on latest version of this package, as well as babel, but I am still receiving this error. Any ideas as to why that might be the case?

@chinesedfan
Copy link
Member

I've now added exportDefaultFrom to the default plugins and it works again.

@rtymchyk Have you changed your configurations like this? If still met this problem, feel free to open a new issue with detailed environments information.

@rtymchyk
Copy link

@chinesedfan Sorry, I misread. I thought the PR was including this as a plugin already. Working fine now, but definitely would be great to utilize the central Babel config instead of this.

@petercpwong
Copy link

For those who stumbled upon this issue from Google and are confused, just add this to your .stylelintrc:

{
  "processors": [
    ["stylelint-processor-styled-components", {
      "parserPlugins": [
        "jsx",
        "objectRestSpread",
        ["decorators", { "decoratorsBeforeExport": true }],
        "classProperties",
        "exportExtensions",
        "asyncGenerators",
        "functionBind",
        "functionSent",
        "dynamicImport",
        "optionalCatchBinding",
        "optionalChaining",
        "exportDefaultFrom"
      ]
    }]
  ],

  ... REST OF YOUR CONFIG

}

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

No branches or pull requests

4 participants