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

__esModule is true while no default export provided, breaks interoperability #1181

Closed
lhstock opened this issue Apr 29, 2022 · 2 comments
Closed

Comments

@lhstock
Copy link

lhstock commented Apr 29, 2022

A common way to transpile ES module import to CommonJS require:

n.n = function(e) {
            var t = e && e.__esModule ? function() {
                return e.default
            }
            : function() {
                return e
            }
            ;
            return n.d(t, "a", t),
            t
        }

So this change breaks a lot of owl.

Version 1.4.6 works properly, but version 1.4.10 is wrong.
image
image

@ged-odoo
Copy link
Contributor

hmm, this line is added by typescript i think. not sure why and how to solve this. @SimonGenin

@ged-odoo
Copy link
Contributor

Could you give us a more precise description of what you want to do and how you do it? in theory, commonjs modules are handled properly in the build process and in the package.json main key.

ged-odoo added a commit that referenced this issue Jul 12, 2022
As far as I can tell, the browser value overrides the main value in many
cases.  But then, we don't want to use the iife format, since it don't
work well with bundlers. This commit fixes the issue by simply removing
the key, so the main entry will be used instead.

maybe fixes #1181
ged-odoo added a commit that referenced this issue Jul 20, 2022
As far as I can tell, the browser value overrides the main value in many
cases.  But then, we don't want to use the iife format, since it don't
work well with bundlers. This commit fixes the issue by simply removing
the key, so the main entry will be used instead.

maybe fixes #1181
ged-odoo added a commit that referenced this issue Jul 20, 2022
As far as I can tell, the browser value overrides the main value in many
cases.  But then, we don't want to use the iife format, since it don't
work well with bundlers. This commit fixes the issue by simply removing
the key, so the main entry will be used instead.

maybe fixes #1181
phil-form pushed a commit to phil-form/owl that referenced this issue Nov 7, 2023
As far as I can tell, the browser value overrides the main value in many
cases.  But then, we don't want to use the iife format, since it don't
work well with bundlers. This commit fixes the issue by simply removing
the key, so the main entry will be used instead.

maybe fixes odoo#1181
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

2 participants