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

Uncaught DOMException: Failed to set the 'domain' property on 'Document': 'cleverapp.io' is a top-level domain. #5722

Closed
AlexLo33 opened this issue Nov 18, 2019 · 6 comments · Fixed by #5726
Assignees

Comments

@AlexLo33
Copy link

@AlexLo33 AlexLo33 commented Nov 18, 2019

Current behavior:

I am currently trying to launch Cypress on an application deployed via Clever Cloud with their own url :

https://dev-xxxx.cleverapps.io

But I can't launch Cypress because of this error :

Uncaught DOMException: Failed to set the 'domain' property on 'Document': 'cleverapps.io' is a top-level domain.

I already saw this issue : #3717 and the problem is with the lib "parse-domain"

I have ran some tests with this lib, and the current behavior of the lib and here is the results :

Code :

const parseDomain = require('parse-domain');

console.log(
  parseDomain('http://dev.classea12.beta.gouv.fr', {
    privateTlds: true,
    customTlds: /^[\d\.]+$/
  })
);

console.log(
  parseDomain('https://dev-xxx.cleverapps.io', {
    privateTlds: true,
    customTlds: /^[\d\.]+$/
  })
);

Results :

2.1.7 => (bugged version)
http://dev.classea12.beta.gouv.fr => { tld: 'fr', domain: 'gouv', subdomain: 'dev.classea12.beta' }
https://dev-xxx.cleverapps.io => { tld: 'cleverapps.io', domain: 'dev-xxx', subdomain: '' }

2.0.0 => (current version in Cypress)
http://dev.classea12.beta.gouv.fr => { tld: 'gouv.fr', domain: 'beta', subdomain: 'dev.classea12' }
https://dev-xxx.cleverapps.io => { tld: 'io', domain: 'cleverapps', subdomain: 'dev-xxx' }
  
2.3.4 (current version of parse-domain) =>
http://dev.classea12.beta.gouv.fr => { tld: 'gouv.fr', domain: 'beta', subdomain: 'dev.classea12' }
https://dev-xxx.cleverapps.io => { tld: 'cleverapps.io', domain: 'dev-xxx', subdomain: '' }

I think it will work if the tld is "cleverapps.io" but actually the tld found is "io"...

So, i think it will work for both tests on actual version 2.3.4

Desired behavior:

I just want to launch Cypress on our test environnement...

Steps to reproduce: (app code and test code)

Launch Cypress on https://localhost:3002 or https://www.bluevalet.fr

=> Working ✔️

Launch Cypress on https://dev-xxx.cleverapps.io

=> Not working

Versions

Cypress 3.6.1
Windows 10

@AlexLo33

This comment has been minimized.

Copy link
Author

@AlexLo33 AlexLo33 commented Nov 18, 2019

If you really want to test, we have 2 URL for our production website :

https://prod-bluevalet.cleverapps.io

and

https://www.bluevalet.fr

The first one can't be launched via Cypress, the second one works perfectly.

@AlexLo33

This comment has been minimized.

Copy link
Author

@AlexLo33 AlexLo33 commented Nov 18, 2019

FYI, I found why the domain cleverapps.io is not found by the module.
The module "parse-domain" uses this list of domains :

https://publicsuffix.org/list/public_suffix_list.dat

The domain cleverapps.io was added by this pull publicsuffix/list#634, on Apr 9, 2018. The version 2.0.0 (https://github.com/peerigon/parse-domain/tree/v2.0.0) used by Cypress was build the Dec 3, 2017. So my domain name is not recognized by the module...

That's why the new version works with my URL...

@flotwig

This comment has been minimized.

Copy link
Member

@flotwig flotwig commented Nov 18, 2019

Thanks for creating this issue @AlexLo33, we have been stuck on an older version of parse-domain because of this bug: peerigon/parse-domain#67

The bug was fixed in 2.3.2 so now we can start using new versions of parse-domain again 🎉.

There is a PR to update parse-domain here: #5726

@AlexLo33

This comment has been minimized.

Copy link
Author

@AlexLo33 AlexLo33 commented Nov 19, 2019

Thank you, we are waiting for this PR to be done !

👍

@cypress-bot

This comment has been minimized.

Copy link

@cypress-bot cypress-bot bot commented Nov 19, 2019

The code for this is done in cypress-io/cypress#5726, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot

This comment has been minimized.

Copy link

@cypress-bot cypress-bot bot commented Nov 27, 2019

Released in 3.7.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.