cypress: Error: EISDIR: illegal operation on a directory

Current behavior:

Error message is thrown

Error: EISDIR: illegal operation on a directory, 
open 'C:\Users\*********\AppData\Roaming\Cypress\cy\production\projects\CyDemo-f6363983d1108dd01027bb4ab06585aa\bundles

Desired behavior:

On clicking signIn button user should land on dashboard page

How to reproduce:

Submit userId and password in respective fields and hit signIn

Test code:

function loadFixture() {
    cy.fixture('login').as('loginJson')
}
describe('Login', function () {
    beforeEach(function () {
        loadFixture()
    })

    before(function () {
        cy.visit('https://*************.com');
    })

    it('It Should load in to the application', function () {
        cy.title().should('contain', 'xyz');
    })

    it('It Should enter credentials and login', function () {
        cy.get('#Username').type(this.loginJson.masterCoder.email).should('have.value', this.loginJson.masterCoder.email);
        cy.get('#Password').type(this.loginJson.masterCoder.password).should('have.value', this.loginJson.masterCoder.password);
        cy.get('.button-label.ng-binding').and('be.visible').click();
    })
});

Additional Info (images, stack traces, etc)

cypresserror

  • Operating System: Windows10 64bit
  • Cypress Version: 1.4.1
  • Browser Version: 63.0.3239.132

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 10
  • Comments: 58 (16 by maintainers)

Commits related to this issue

Most upvoted comments

Wonder why this bug is labeled as “stage: needs information”? There are couple reproduce steps in the discussion. Is any Cypress team member looking at this?

This is an issue that blocks us to run integration tests in our build pipeline for months. It’s also intermittently failed to run local test files.

I’m getting the same issue on 4.0.1

The spec submits a form and loads a new page. The URL that should be loaded is: https://domain/#/integrations/id and the URL that Cypress is getting stuck on is https://domain/__/#integrations/id

image

Also it seems strange to me that there’s like… a testrunner window within the testrunner window?

@OliaYesss Thanks for providing a reproducible example. I can see this failing. Adding the new experimentalSourceRewriting flag does not change the behavior in this case.

reproducible example

it('illegal operation on a directory', () => {
  cy.visit('https://www.staging.nutheorie.be/')
  cy.get('select[name="city"]').eq(0).select('auto-theorie-cursus-amsterdam')
  cy.get('#course').select('15-06-2020')
  cy.get('.btn-block > button[type="submit"]').eq(0).click()
})
Screen Shot 2020-06-15 at 2 52 53 PM

debug logs

  cypress:browserify get: /Users/jennifer/Dev/cypress-transform-test +3ms
  cypress:browserify input: /Users/jennifer/Dev/cypress-transform-test +0ms
  cypress:browserify output: /Users/jennifer/Library/Application Support/Cypress/cy/production/projects/cypress-transform-test-74d5161f4a1005f86b0d85a657ddcf07/bundles +0ms
  cypress:browserify browserifyOptions: { extensions: [ '.js', '.jsx', '.coffee' ], transform: [ [ '/Users/jennifer/Library/Caches/Cypress/4.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/coffeeify/index.js', {} ], [ '/Users/jennifer/Library/Caches/Cypress/4.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/babelify/index.js', [Object] ] ], plugin: [], cache: {}, packageCache: {}, debug: true, entries: [ '/Users/jennifer/Dev/cypress-transform-test' ] } +1ms
  cypress:browserify watching +4ms
  cypress:browserify making bundle /Users/jennifer/Library/Application Support/Cypress/cy/production/projects/cypress-transform-test-74d5161f4a1005f86b0d85a657ddcf07/bundles +2ms
  cypress:browserify errored bundling: /Users/jennifer/Library/Application Support/Cypress/cy/production/projects/cypress-transform-test-74d5161f4a1005f86b0d85a657ddcf07/bundles [Error: EISDIR: illegal operation on a directory, open '/Users/jennifer/Library/Application Support/Cypress/cy/production/projects/cypress-transform-test-74d5161f4a1005f86b0d85a657ddcf07/bundles'

] {
  errno: -21,
  code: 'EISDIR',
  syscall: 'open',
  path: '/Users/jennifer/Library/Application Support/Cypress/cy/production/projects/cypress-transform-test-74d5161f4a1005f86b0d85a657ddcf07/bundles',
  filePath: '/Users/jennifer/Dev/cypress-transform-test',
  originalStack: "Error: EISDIR: illegal operation on a directory, open '/Users/jennifer/Library/Application Support/Cypress/cy/production/projects/cypress-transform-test-74d5161f4a1005f86b0d85a657ddcf07/bundles'\n" +
    '\n'
} +1ms
EISDIR: illegal operation on a directory, open '/Users/jennifer/Library/Application Support/Cypress/cy/production/projects/cypress-transform-test-74d5161f4a1005f86b0d85a657ddcf07/bundles'
GET /__cypress/tests?p= 200 11.873 ms - 302
  cypress:browserify errored bundling: /Users/jennifer/Library/Application Support/Cypress/cy/production/projects/cypress-transform-test-74d5161f4a1005f86b0d85a657ddcf07/bundles Error: Cannot find module '/Users/jennifer/Dev/cypress-transform-test' from '/Users/jennifer/Dev/cypress-transform-test'
    at /Users/jennifer/Library/Caches/Cypress/4.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/browser-resolve/node_modules/resolve/lib/async.js:55:21
    at load (/Users/jennifer/Library/Caches/Cypress/4.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/browser-resolve/node_modules/resolve/lib/async.js:69:43)
    at onex (/Users/jennifer/Library/Caches/Cypress/4.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/browser-resolve/node_modules/resolve/lib/async.js:92:31)
    at /Users/jennifer/Library/Caches/Cypress/4.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/browser-resolve/node_modules/resolve/lib/async.js:22:47
    at callback (/Users/jennifer/Library/Caches/Cypress/4.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/graceful-fs/polyfills.js:289:20)
    at FSReqCallback.oncomplete (fs.js:158:21)
 {
  stream: Labeled {
    _readableState: ReadableState {
      objectMode: true,
      highWaterMark: 16,
      buffer: BufferList { length: 0 },
      length: 0,
      pipes: [Labeled],
      pipesCount: 1,
      flowing: true,
      ended: false,
      endEmitted: false,
      reading: true,
      sync: false,
      needReadable: true,
      emittedReadable: false,
      readableListening: false,
      resumeScheduled: false,
      destroyed: false,
      defaultEncoding: 'utf8',
      awaitDrain: 0,
      readingMore: false,
      decoder: null,
      encoding: null
    },
    readable: true,
    _events: [Object: null prototype] {
      end: [Array],
      error: [Function],
      data: [Function: ondata],
      _mutate: [Function]
    },
    _eventsCount: 4,
    _maxListeners: undefined,
    _writableState: WritableState {
      objectMode: true,
      highWaterMark: 16,
      finalCalled: false,
      needDrain: false,
      ending: true,
      ended: true,
      finished: true,
      destroyed: false,
      decodeStrings: true,
      defaultEncoding: 'utf8',
      length: 0,
      writing: false,
      corked: 0,
      sync: false,
      bufferProcessing: false,
      onwrite: [Function],
      writecb: null,
      writelen: 0,
      bufferedRequest: null,
      lastBufferedRequest: null,
      pendingcb: 0,
      prefinished: true,
      errorEmitted: false,
      bufferedRequestCount: 0,
      corkedRequestsFree: [CorkedRequest]
    },
    writable: false,
    allowHalfOpen: true,
    _options: { objectMode: true },
    _wrapOptions: { objectMode: true },
    _streams: [ [Deps], [DestroyableTransform] ],
    length: 2,
    label: 'deps'
  },
  filePath: '/Users/jennifer/Dev/cypress-transform-test',
  originalStack: "Error: Cannot find module '/Users/jennifer/Dev/cypress-transform-test' from '/Users/jennifer/Dev/cypress-transform-test'\n" +
    '    at /Users/jennifer/Library/Caches/Cypress/4.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/browser-resolve/node_modules/resolve/lib/async.js:55:21\n' +
    '    at load (/Users/jennifer/Library/Caches/Cypress/4.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/browser-resolve/node_modules/resolve/lib/async.js:69:43)\n' +
    '    at onex (/Users/jennifer/Library/Caches/Cypress/4.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/browser-resolve/node_modules/resolve/lib/async.js:92:31)\n' +
    '    at /Users/jennifer/Library/Caches/Cypress/4.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/browser-resolve/node_modules/resolve/lib/async.js:22:47\n' +
    '    at callback (/Users/jennifer/Library/Caches/Cypress/4.8.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/graceful-fs/polyfills.js:289:20)\n' +
    '    at FSReqCallback.oncomplete (fs.js:158:21)\n'
} +10ms

@jennifer-shehane I has resolved the issue for Cypress tests issue for our team. The root cause is not in Cypress, and is because of missing valid id to load the page (due to slow API), and Cypress couldn’t load the page, which ran into EISDIR: illegal operation…

The way we resolve it: intercept the API as alias and wait for the API complete then move on to next test.

Thank you for the help.

Maybe this example can help.

Current behavior:

When in app change hash location with delay (setTimeout) test will leave current page and go to parent page (cypress runner page). In my case http://localhost:8082/__/#/some/route/1

If set “chromeWebSecurity” to true, when run cypress open and select test get error “CypressError: Cypress detected a cross origin error happened on page load:…” If set “chromeWebSecurity” to false, when run cypress run get error “Error: EISDIR: illegal operation on a directory, open ‘C:\Users\fakeuser\AppData\Roaming\Cypress\cy\production\projects\cypress-playground-98c610aaf979570d4bd341aac2a02314\bundles’”

Desired behavior:

When in app change hash location with delay (setTimeout) test will stay on current page. In my case http://localhost:8082/cy-issue-1244.htm#/some/route/1 Do not want to see any error.

Steps to reproduce: (app code and test code)

cypress.json

{
    "baseUrl": "http://localhost:8082/",
    "chromeWebSecurity": false,
    "video": false
}

App code:

<!DOCTYPE html>
<html>

<head>
    <title>CY issue 1244</title>
    <meta charset="utf-8" />
</head>

<body>
    <div id="my-link">click me</div>
    <script>
        document.getElementById("my-link").addEventListener("click", () => {
            setTimeout(() => window.location.href = "#/some/route/1", 500)
        })
    </script>
</body>

</html>

Test code:

describe('cy issue 1244', () => {
	beforeEach(function () {
		cy.visit("cy-issue-1244.htm")
	})

	it('breake cy with link', () => {
		cy.get('#my-link').contains('click me').click();
		
		cy.wait(1000);

		cy.get('#my-link').contains('click me')
	})
})

Versions

Cypress: package version: 3.6.1 Cypress: binary version: 3.6.1 Operating System: Windows10 64bit Browser: Chrome 78 Electron 73 (headless)

Running into the same issue. Reproduced using same steps to repro on: Cypress: 3.8.0 MacOS Mojave Chrome 79 See this in the console: Screen Shot 2019-12-13 at 1 14 18 PM Related StackOverflow Question

This fix is available starting in 4.6.0 as an experiment which you can access by setting this config option in your cypress.json or elsewhere:

{
	"experimentalSourceRewriting": true
}

The fix is experimental, so there may be some situations where the this is not fixed.

If you’re still this issue while setting the experimentalSourceRewriting to true in 4.6.0 - open a new issue with a reproducible example + screenshots, etc - filling out our issue template.

Hi, I´m having the same issue, these are my steps, done in a test webpage to practice:

describe("My second Test Suite", function () {
    it("My second Test Case", function () {
        cy.visit("https://rahulshettyacademy.com/seleniumPractise/#/");
        cy.get(".search-keyword").type("ca");
        cy.wait(2000); 
        cy.get(".products").as("productLocator");
        cy.get("@productLocator").find(".product").each(($el, index, $list) => {
            const textVeg = $el.find("h4.product-name").text()
            if (textVeg.includes("Cashews")) {
                $el.find("button").click();
            }
        });
        cy.get(".cart-icon > img").click();
        cy.contains("proceed to checkout".toUpperCase()).click();
    })
})

image

And my Cypress configuration:

{
animationDistanceThreshold: 5,
baseUrl: 'https://rahulshettyacademy.com/seleniumPractise/#/',
blacklistHosts: null,
chromeWebSecurity: true,
defaultCommandTimeout: 4000,
env: {},
execTimeout: 60000,
fileServerFolder: '',
fixturesFolder: 'cypress/fixtures',
hosts: null,
ignoreTestFiles: '*.hot-update.js',
integrationFolder: 'cypress/integration',
modifyObstructiveCode: true,
nodeVersion: 'system',
numTestsKeptInMemory: 50,
pageLoadTimeout: 60000,
pluginsFile: 'cypress/plugins',
port: null,
projectId: null,
reporter: 'spec',
reporterOptions: null,
requestTimeout: 5000,
responseTimeout: 30000,
screenshotsFolder: 'cypress/screenshots',
supportFile: 'cypress/support',
taskTimeout: 60000,
testFiles: '**/*.*',
trashAssetsBeforeRuns: true,
userAgent: null,
video: true,
videoCompression: 32,
videoUploadOnPasses: true,
videosFolder: 'cypress/videos',
viewportHeight: 660,
viewportWidth: 1000,
waitForAnimations: true,
watchForFileChanges: true}

It seems to be an issue with the hash # in the URL, I still have the same issue.

Hi, I got the same issue: Screen Shot 2020-06-14 at 11 01 20 PM

Here is my test:

it('drop-down check', () => {
    const URL = 'https://www.staging.nutheorie.be/'

    cy.visit(URL)
    cy.get('select[name="city"]').eq(0).select('auto-theorie-cursus-amsterdam')
    cy.wait(2000)

    const date = new Date()
    date.setDate(date.getDate() + 1)

    const month = date.getMonth() + 1

    cy.get('#course').select(
      date.getDate() + '-' +
      (month < 10 ? '0' : '') + month + '-' +
      date.getFullYear()
    )

    cy.get('.btn-block > button[type="submit"]').eq(0).click()
  })

It reproduced in the almost blanked project (without any additional plugins, etc).

Same goes to me …I can reproduce the issue/error in 3.8.3

GET /__/ 200 2.451 ms - -
GET /__cypress/runner/cypress_runner.js 304 1.255 ms - -
GET /__cypress/runner/cypress_runner.css 200 3.750 ms - -
GET /__cypress/runner/fonts/fa-solid-900.woff2 304 0.434 ms - -
GET /__cypress/iframes/ 200 2.661 ms - 679
Error: EISDIR: illegal operation on a directory, open '/Users/xxxxxx/Library/Application Support/Cypress/cy/production/projects/cypress-project-4e8ebb55d0239bf22387ba859238b047/bundles'

Maybe this example can help.

Current behavior:

When in app change hash location with delay (setTimeout) test will leave current page and go to parent page (cypress runner page). In my case http://localhost:8082/__/#/some/route/1

If set “chromeWebSecurity” to true, when run cypress open and select test get error

CypressError: Cypress detected a cross origin error happened on page load:...

If set “chromeWebSecurity” to false, when run cypress run get error

Error: EISDIR: illegal operation on a directory, open 'C:\Users\fakeuser\AppData\Roaming\Cypress\cy\production\projects\cypress-playground-98c610aaf979570d4bd341aac2a02314\bundles'

Desired behavior:

When in app change hash location with delay (setTimeout) test will stay on current page. In my case http://localhost:8082/cy-issue-1244.htm#/some/route/1 Do not want to see any error.

Steps to reproduce: (app code and test code)

cypress.json

{
    "baseUrl": "http://localhost:8082/",
    "chromeWebSecurity": false,
    "video": false
}

App code:

<!DOCTYPE html>
<html>

<head>
    <title>CY issue 1244</title>
    <meta charset="utf-8" />
</head>

<body>
    <div id="my-link">click me</div>
    <script>
        document.getElementById("my-link").addEventListener("click", () => {
            setTimeout(() => window.location.href = "#/some/route/1", 500)
        })
    </script>
</body>

</html>

Test code:

describe('cy issue 1244', () => {
	beforeEach(function () {
		cy.visit("cy-issue-1244.htm")
	})

	it('breake cy with link', () => {
		cy.get('#my-link').contains('click me').click();
		
		cy.wait(1000);

		cy.get('#my-link').contains('click me')
	})
})

Versions

Cypress: package version: 3.6.1 Cypress: binary version: 3.6.1 Operating System: Windows10 64bit Browser: Chrome 78 Electron 73 (headless)