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

fix: Update getAuthToken for ES6 modules #6156

Merged
merged 4 commits into from
Mar 25, 2020
Merged

Conversation

focusaurus
Copy link
Contributor

Impact: minor
Type: bugfix|chore

Issue

The bin/token script printed a bunch of confusing ES6 warnings to stderr:

(node:100531) Warning: require() of ES modules is not supported.
require() of .reaction/getAuthToken.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
Instead rename getAuthToken.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from package.json.

Solution

Update to modern import javascript syntax.

Breaking changes

None

Testing

  1. Run the script with a userid command line argument. If no warnings, all's good.

@rosshadden rosshadden merged commit 5c5f647 into trunk Mar 25, 2020
@rosshadden rosshadden deleted the es6ify-get-auth-token branch March 25, 2020 15:23
@kieckhafer kieckhafer mentioned this pull request Apr 2, 2020
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

Successfully merging this pull request may close these issues.

2 participants