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

interopNamespace added when interop is disabled #3288

Closed
gingur opened this issue Dec 17, 2019 · 6 comments · Fixed by #3710
Closed

interopNamespace added when interop is disabled #3288

gingur opened this issue Dec 17, 2019 · 6 comments · Fixed by #3710

Comments

@gingur
Copy link

gingur commented Dec 17, 2019

  • Rollup Version: 1.27.9
  • Operating System (or Browser): Windows 10
  • Node Version: 10.15.3

How Do We Reproduce?

// rollup.config.js
config.output.format = 'cjs';
config.output.interop = false;

// entry
import('someExternal');

Expected Behavior

new Promise(function (resolve) { resolve(require('someExternal')); });

Actual Behavior

new Promise(function (resolve) { resolve(_interopNamespace(require('someExternal'))); });
@shellscape
Copy link
Contributor

Thanks for opening an issue, and apologies that it took a while to get a response. Citing the issue template:

Issues without minimal reproductions will be closed! Please provide one by:

  1. Using the REPL at https://rollupjs.org/repl/, or
  2. Work to isolate the problem and provide the exact steps in this issue, or
  3. Provide a minimal repository link (Read https://git.io/fNzHA for instructions).
    These may take more time to triage than the other options.

Please add a reproduction and we'll be happy to triage further.

@gingur
Copy link
Author

gingur commented Dec 27, 2019

@shellscape pretty sure I provided #2, I isolated the problem to a config flag, and provided the line of code. If you require #1 or #3 only, I would suggest removing #2 from your template.

@gingur
Copy link
Author

gingur commented Dec 27, 2019

Pretty sure the REPL doesn't use a file named rollup.config.js, but this is essentially the source https://tinyurl.com/wecehq3

@lukastaegert
Copy link
Member

Yes, I think the interop flag was not considered when creating the interop logic for dynamic namespaces. Marking this as a bug as the suggested behaviour makes a lot of sense. I do not think it would be a big change so PR definitely welcome.

@gingur
Copy link
Author

gingur commented Mar 27, 2020

update:, still an issue in 2.2.0

@lukastaegert
Copy link
Member

Fix at #3710

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants