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

External Modules don't output correctly for 'global' type. #6933

Closed
marcusdarmstrong opened this issue Apr 2, 2018 · 7 comments
Closed

External Modules don't output correctly for 'global' type. #6933

marcusdarmstrong opened this issue Apr 2, 2018 · 7 comments

Comments

@marcusdarmstrong
Copy link
Contributor

marcusdarmstrong commented Apr 2, 2018

runtime.outputOptions.globalObject,

Hi there, in attempting to get our server side bundles set up properly, I think I discovered a bug introduced alongside the addition of configurable global objects (d95f93f)

As of Webpack 4.4.1, this is the output I get back from the 'global' option:

/***/ (function(module, exports) {

(function() { module.exports = global["self"]; }());

/***/ })

I believe the intent of the commit was:

return this.getSourceForGlobalVariableExternal(request, runtime.outputOptions.globalObject);

Which would lookup the module by name in the provided global object.

Do you want to request a feature or report a bug? Bug

What is the current behavior? the source() of an ExternalModule with type 'global' yields the above snippet.

If the current behavior is a bug, please provide the steps to reproduce. Call .source() on an ExternalModule with type 'global'.

What is the expected behavior? I believe the intent is to lookup the module by name in the configured global, rather than look up the configured global in global scope (which is kinda what the current code does?)

If this is a feature request, what is motivation or use case for changing the behavior? N/A

Please mention other relevant information such as the browser version, Node.js version, webpack version, and Operating System. Webpack 4.4.1, but it's the same in master.

@montogeek
Copy link
Member

montogeek commented Apr 2, 2018

It looks like you just deleted our lovely crafted issue template. It was there for good reasons. Please help us solving your issue by answering the questions asked in this template.

@marcusdarmstrong
Copy link
Contributor Author

marcusdarmstrong commented Apr 2, 2018

Sorry about that, I didn't delete the issue template. I opened the issue from the github source browser, so it never gave me a template in the first place. I've updated the issue with the fields.

@sokra
Copy link
Member

sokra commented Apr 4, 2018

Yep, that's wrong, send a PR

@webpack-bot
Copy link
Contributor

This issue had no activity for at least half a year.

It's subject to automatic issue closing if there is no activity in the next 15 days.

sokra added a commit that referenced this issue Oct 17, 2018
…nal-module-fix

Correct ExternalModule's global option (#6933)
@edmorley
Copy link
Contributor

I believe this can be closed now, since #7038 was merged.

@webpack-bot
Copy link
Contributor

This issue had no activity for at least half a year.

It's subject to automatic issue closing if there is no activity in the next 15 days.

@alexander-akait
Copy link
Member

Solved in #7038

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

No branches or pull requests

6 participants