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

JSDOM initialization conflict #59

Open
tsapmic opened this issue May 29, 2023 · 0 comments
Open

JSDOM initialization conflict #59

tsapmic opened this issue May 29, 2023 · 0 comments

Comments

@tsapmic
Copy link

tsapmic commented May 29, 2023

GPXparser initialize jsdom when it finds that module is not defined:

if(typeof module !== 'undefined'){
    require('jsdom-global')();
    module.exports = gpxParser;
}

In case if dom will be configured somewhere else it could cause conflicts.

In my case: I have a Vue application using GPXParser and running tests with vitest causing double jsdom initialization.

Could you please change it to something like this:

if(typeof module !== 'undefined'){
    if (typeof document == 'undefined') {
        require('jsdom-global')();
    }
    module.exports = gpxParser;
}
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

1 participant