-
Notifications
You must be signed in to change notification settings - Fork 5
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: change to output as ES modules #365
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
akash1810
changed the title
fix: change to output as es modules
fix: change to output as ES modules
Mar 30, 2021
This library is broken since v6.0.1 after PR #356. Users face this stack trace: ``` Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /Users/philip_mcmahon/code/editions/projects/aws/node_modules/read-pkg-up/index.js require() of ES modules is not supported. require() of /Users/philip_mcmahon/code/editions/projects/aws/node_modules/read-pkg-up/index.js from /Users/philip_mcmahon/code/editions/projects/aws/node_modules/@guardian/cdk/lib/constants/library-info.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 index.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/philip_mcmahon/code/editions/projects/aws/node_modules/read-pkg-up/package.json. ``` This change updates tsconfig to output as ES modules rather than commonjs. This slightly goes against the recommendations (https://github.com/guardian/recommendations/blob/master/npm-packages.md#compiling), however as the library only gets used in controlled environments, this should be fine.
philmcmahon
approved these changes
Mar 30, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
🎉 This PR is included in version 6.2.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
akash1810
added a commit
that referenced
this pull request
Mar 30, 2021
This reverts commit b4ad69d.
akash1810
added a commit
that referenced
this pull request
Mar 31, 2021
This reverts commit b4ad69d.
akash1810
added a commit
that referenced
this pull request
Mar 31, 2021
This reverts commit b4ad69d.
akash1810
added a commit
that referenced
this pull request
Mar 31, 2021
This reverts commit b4ad69d.
akash1810
added a commit
that referenced
this pull request
Mar 31, 2021
This reverts commit b4ad69d.
akash1810
added a commit
that referenced
this pull request
Mar 31, 2021
This reverts commit b4ad69d.
This was referenced Mar 31, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this change?
This library is broken since v6.0.1 after PR #356. Users face this stack trace:
This change updates tsconfig to output as ES modules rather than commonjs. This slightly goes against the recommendations (https://github.com/guardian/recommendations/blob/master/npm-packages.md#compiling), however as the library only gets used in controlled environments, this should be fine.
Does this change require changes to existing projects or CDK CLI?
No.
How to test
@guardian/cdk
How can we measure success?
The library can be used again!
Have we considered potential risks?
n/a