Skip to content

provide path to js in main entry, fixes #494 #495

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

Closed
wants to merge 1 commit into from
Closed

Conversation

gugu
Copy link
Contributor

@gugu gugu commented Nov 3, 2020

No description provided.

@@ -34,7 +34,7 @@
"docs",
"package-lock.json"
],
"main": "./lib/passport-saml",
"main": "./lib/passport-saml/index.js",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm OK with this change, and I actually expected this to be this way from the beginning. I guess I'm curious why everything has been working for so long with an abstract main (I checked the history) and now it is broken.

@markstos
Copy link
Contributor

markstos commented Nov 3, 2020

@gugu did you test the fix with Babel? I don't think is this the issue. If you look at the JavaScript we generate in ../lib/passport-saml/index.js you can see it contains __esModule: true. If you look the code in #494, you can see references to cjs, or Common JS modules. So it seems like we have perhaps there's a mismatch between an expectation about whether the module is a Common JS module or an ES 6 module. There may be specific issues related to this topic and Babel:

https://2ality.com/2017/01/babel-esm-spec-mode.html

It seems Babel may be looking for __esModule in particular (it's mentioned at the URL above).

I'm not an expert in TypeScript, Babel and how these interact with Common JS and ES 6 modules, but that seems to the be area where the issue lies.

@markstos
Copy link
Contributor

markstos commented Nov 4, 2020

The actual fix as posted here: #494 (comment)

@cjbarth cjbarth deleted the main-field-fix branch March 16, 2021 11:16
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