Skip to content

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

Closed
@AlexLo33

Description

@AlexLo33

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

Activity

AlexLo33

AlexLo33 commented on Nov 18, 2019

@AlexLo33
Author

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

AlexLo33 commented on Nov 18, 2019

@AlexLo33
Author

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...

self-assigned this
on Nov 18, 2019
flotwig

flotwig commented on Nov 18, 2019

@flotwig
Contributor

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

AlexLo33 commented on Nov 19, 2019

@AlexLo33
Author

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

👍

cypress-bot

cypress-bot commented on Nov 19, 2019

@cypress-bot
Contributor

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

cypress-bot commented on Nov 27, 2019

@cypress-bot
Contributor

Released in 3.7.0.

locked as resolved and limited conversation to collaborators on Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @flotwig@AlexLo33

    Issue actions

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