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

Error: The 'decorators' plugin requires a 'decoratorsBeforeExport' option #38

Open
gotjoshua opened this issue Aug 28, 2018 · 9 comments

Comments

@gotjoshua
Copy link

Atom 1.29.0 - Mac 10.11 - in a meteor project - cmd-shift-i gives this error:

Uncaught (in promise) Error: Error: The 'decorators' plugin requires a 'decoratorsBeforeExport' option, whose value must be a boolean.
    at new Importer (/Users/usernam/.atom/packages/atom-import-js/node_modules/import-js/build/Importer.js:118)
    at getImporter (/Users/usernam/.atom/packages/atom-import-js/lib/getImporter.js:8)
    at withModuleFinder (/Users/usernam/.atom/packages/atom-import-js/lib/import-js.js:121)
    at initializeModuleFinder.then.catch (/Users/usernam/.atom/packages/atom-import-js/lib/withModuleFinder.js:8)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188)
Importer @ /Users/usernam/.atom/packages/atom-import-js/node_modules/import-js/build/Importer.js:118
getImporter @ /Users/usernam/.atom/packages/atom-import-js/lib/getImporter.js:8
withModuleFinder @ /Users/usernam/.atom/packages/atom-import-js/lib/import-js.js:121
initializeModuleFinder.then.catch @ /Users/usernam/.atom/packages/atom-import-js/lib/withModuleFinder.js:8
_tickCallback @ internal/process/next_tick.js:188
Promise rejected (async)
withModuleFinder @ /Users/usernam/.atom/packages/atom-import-js/lib/withModuleFinder.js:6
fixImports @ /Users/usernam/.atom/packages/atom-import-js/lib/import-js.js:120
import-js:fix-imports @ /Users/usernam/.atom/packages/atom-import-js/lib/import-js.js:155
handleCommandEvent @ commitCommentContainer_item.graphql.js:112
module.exports.KeymapManager.dispatchCommandEvent @ commitCommentContainer_item.graphql.js:112
module.exports.KeymapManager.handleKeyboardEvent @ commitCommentContainer_item.graphql.js:112
handleDocumentKeyEvent @ commitCommentContainer_item.graphql.js:112

any known workarounds

@trotzig
Copy link
Contributor

trotzig commented Aug 30, 2018

Hi! Sorry you're hitting this issue!

The same thing has been reported upstream as well: Galooshi/import-js#515. The workaround is to install an older version of the plugin, or switch your project over to babel 7 (I think).

@gotjoshua
Copy link
Author

Hey Thanks for your reply!

It seems that the decorators plugin requires an explicit value now...
babel/babel#8562

but I don't get where to set it... Is atom-import-js using a decorators plugin?
does it belong in my project .babelrc?

I have a Meteor project (METEOR@1.7.1-rc.5)
and i am not using any decorators plugin at the top level - could this be an issue that comes from a sub-dependency?

@gotjoshua
Copy link
Author

I want to cross post a meteor thread here, because I really want to get to the bottom of this error:
https://forums.meteor.com/t/babel-what-is-required-where-and-why/45420/2

Would changes to my project's babelrc file affect the operation of the atom-import-js package?

I downgraded to atom-import-js 0.14.0, by uninstalling and then running:
apm install atom-import-js@0.14.0
Now i don't get the error anymore... but i still want to understand how to update.

Also curiously enough my colleague is able to run v0.15.0 in the same project repo!

hoping for insight...

@the-simian
Copy link

the-simian commented Sep 3, 2018

Don't forget the babel-eslint flag if you're using this babel/babel-eslint#679 , that also changed very recently and that got me.

ecmaFeatures: {
  legacyDecorators: true
}

@gotjoshua
Copy link
Author

Thanks!
does that belong in the .eslintrc file? if so, as a top level option? or under parser options?

@the-simian
Copy link

the-simian commented Sep 3, 2018

parser options like

{
  "parser": "babel-eslint",
  "parserOptions": {
    "ecmaVersion": 6,
    "sourceType": "module",
    "ecmaFeatures": {
      "modules": true,
      "legacyDecorators": true
    }
  },
//... rest of linter file
}

@trotzig
Copy link
Contributor

trotzig commented Sep 5, 2018

It looks like this is the same issue as Galooshi/import-js#515. Any help debugging this is deeply appreciated 🙏.

trotzig added a commit that referenced this issue Sep 10, 2018
This version has a bugfix for #38
@kakenbok
Copy link

kakenbok commented Nov 2, 2018

Don't forget the babel-eslint flag if you're using this babel/babel-eslint#679 , that also changed very recently and that got me.

ecmaFeatures: {
  legacyDecotators: true
}

Mind the typo:

legacyDecota--->t<---ors

This worked well for me:

  parserOptions: {
    parser: 'babel-eslint',
    'ecmaFeatures': {
      'legacyDecorators': true
    }
  }

@the-simian
Copy link

@kakenbok fixed spelling on initial comment! thanks

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

No branches or pull requests

4 participants