Skip to content

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

@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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions