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

global in current amd/umd wrapper undefined in strict mode #2482

Closed
1 of 3 tasks
DanielRuf opened this issue Feb 12, 2018 · 8 comments
Closed
1 of 3 tasks

global in current amd/umd wrapper undefined in strict mode #2482

DanielRuf opened this issue Feb 12, 2018 · 8 comments
Labels

Comments

@DanielRuf
Copy link
Contributor

In specific scenarios the global variable in the generated amd/umd wrapper is undefined.
Normally it should be window and most libraries need a if(global === undefined && window!== undefined) global = window; to fix this.

This is a (multiple allowed):

  • bug

  • enhancement

  • feature-discussion (RFC)

  • Swiper Version: 4.1.6

  • Platform/Target and Browser Versions: macOS.

What you did

EXPLAIN WHAT YOU DID, PREFERABLY WITH CODE EXAMPLES, HERE. (todo)

Expected Behavior

EXPLAIN WHAT IS TO BE EXPECTED, HERE. (todo)

Actual Behavior

EXPLAIN WHAT IS ACTUALLY HAPPENING, HERE. (todo)

@DanielRuf
Copy link
Contributor Author

DanielRuf commented Feb 21, 2018

Something like bebraw/libumd@f43a331 is needed.

dimsemenov/PhotoSwipe#1413

@DanielRuf
Copy link
Contributor Author

More references:

fians/Waves#181
jonathantneal/svg4everybody#162

@DanielRuf DanielRuf reopened this Feb 21, 2018
@nolimits4web
Copy link
Owner

This is actually UMD definition which should work correct in most of cases where it is used correctly. Can you show me an example of such env where it will throw an error?

@nolimits4web
Copy link
Owner

If you mean in something like this:

function () {
  'use strict';
  // ... full swiper.js source code here
}

Then it will throw an error, but i would say it is a wrong usage rather then UMD issue

@DanielRuf
Copy link
Contributor Author

DanielRuf commented Feb 23, 2018

You can ask @bebraw of libumd as there is also this fix ;-)

@mikestreety
Copy link

I can confirm this solved an issue for me where I didn't want to install via node_modules and was just including the downloaded file in my Vue project. Thanks @DanielRuf.

@stale
Copy link

stale bot commented Jun 22, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 22, 2018
@stale
Copy link

stale bot commented Jul 6, 2018

This issue has been automatically closed due to inactivity. If this issue is still actual, please, create the new one.

@stale stale bot closed this as completed Jul 6, 2018
@lock lock bot added the outdated label Mar 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Mar 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants