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

require() of ES Module #205

Closed
christian-bromann opened this issue Sep 5, 2023 · 8 comments · Fixed by #206
Closed

require() of ES Module #205

christian-bromann opened this issue Sep 5, 2023 · 8 comments · Fixed by #206

Comments

@christian-bromann
Copy link
Contributor

It seems like the recent update to the package, bumped the version of got to 12.6.0 which is a ESM only package. This breaks the whole package because it runs in CJS (see #153).

Raised by webdriverio/webdriverio#11077 (comment)

@diemol
Copy link
Member

diemol commented Sep 5, 2023

That was an oversight on my part.

I will move got to 11.8.6 and make a new release.

@diemol
Copy link
Member

diemol commented Sep 5, 2023

7.3.1 is out.

@redbugz
Copy link

redbugz commented Sep 13, 2023

Seems we need a 7.3.2 for query-string now:
a781410#commitcomment-127284025

@itssumitrai
Copy link

Same, seeing ES module issue with query-string

@diemol
Copy link
Member

diemol commented Sep 13, 2023

See #207

I will have time again to check this next week.

@snyamathi
Copy link

snyamathi commented Oct 5, 2023

@diemol Has this change been released, or do you have time to create a release? I still see query-string v8.1.0 in the latest version

$ curl -s https://registry.npmjs.org/saucelabs/latest | jq '.dependencies' -
{
  "@xhmikosr/downloader": "^13.0.1",
  "change-case": "^4.1.2",
  "form-data": "^4.0.0",
  "got": "^11.8.6",
  "hash.js": "^1.1.7",
  "query-string": "^8.1.0",
  "tunnel": "^0.0.6",
  "yargs": "^17.2.1"
}

@diemol
Copy link
Member

diemol commented Oct 6, 2023

Work still needs to be done to fix this.

@lotuswood
Copy link

lotuswood commented Oct 7, 2023

@diemol
Based upon what I see in the 7.3.1 tag, I wonder if you can update your saucelabs/build/index.js to have something like
const queryString = await import('./query-string');
instead of the current
import queryString from 'query-string;'

to fix this ERR_REQUIRE_ESM error, given that cjs modules generally need to load esm modules using the dynamic import syntax as per suggested by the original error message?

It may not be a good long term solution to downgrade your query-string dependency to its older cjs module, if #207 is what you intend to release as a fix to this prob.

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

Successfully merging a pull request may close this issue.

6 participants