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

fixes esm exports #1269

Merged
merged 3 commits into from
Aug 15, 2022
Merged

fixes esm exports #1269

merged 3 commits into from
Aug 15, 2022

Conversation

jaredperreault-okta
Copy link
Contributor

No description provided.

@@ -18,7 +18,8 @@
},
"browser": {
"types": "./build/lib/index.d.ts",
"import": "./build/esm/browser/index.js"
"import": "./build/esm/browser/index.js",
"default": "./build/esm/browser/index.js"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jest@28 updated it's resolver algorithm, jest will now resolve the "default" export

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jest@28 starts using the esm bundle by default? or config will be needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it prioritizes esm bundle specifically (jest considers it's esm support to be experimental), but it changed the preference of which exports it consumes.
(I turned off the moduleMapper config when testing this)

More info here: #1268

@@ -98,7 +98,10 @@ fs.writeFileSync(`${BUILD_DIR}/package.json`, JSON.stringify(packageJSON, null,

// Add an extra package.json underneath ESM to indicate module type
// This helps tools like Jest identify this code as ESM
// (name and version are required for MFE)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version of auth-js fails Module Federation builds (via webpack 5). Seems related to webpack/webpack#13457. Adding name and version to this "dummy" package.json fixes the issue

@jaredperreault-okta jaredperreault-okta marked this pull request as ready for review August 11, 2022 14:00
@jaredperreault-okta
Copy link
Contributor Author

May resolve #1270 as well

Copy link
Contributor

@shuowu-okta shuowu-okta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please also add changelog

@eng-prod-CI-bot-okta eng-prod-CI-bot-okta merged commit 2c66e80 into 6.7 Aug 15, 2022
shuowu-okta pushed a commit that referenced this pull request Aug 31, 2022
shuowu-okta pushed a commit that referenced this pull request Aug 31, 2022
eng-prod-CI-bot-okta pushed a commit that referenced this pull request Aug 31, 2022
OKTA-529463 fix: use umd bundle as browser default
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.

3 participants