question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Reactjs][GeckoDriver] O_CREAT", _c.fs is undefined in ./node_modules/tmp/lib/tmp.js

See original GitHub issue

🐛 Bug Report

I want run Selenium inside a component but “TypeError: _c.fs is undefined.” I got also “TypeError: can’t access property “O_CREAT”, _c.fs is undefined”

image

To Reproduce

create react app and use inside random/dummy component and above all: trigger this with button 😃 copy/past

async function getHtml(url: string) {
    const driver = await new Builder().forBrowser("firefox").build();
    let res = "<div></div>"
    try {
        await driver.get(url);
        res = await driver.getPageSource();
    }
    finally {

        await driver.quit();
        return res
    }
}

Expected behavior

not throwing error and get the html.

Environment

OS: Windows 10? OSX Browser: Geckodriver Browser version: my browser version is Mozilla 86/87 Browser Driver version: GeckoDriver 0.29.0 Language Bindings version: node v15.6

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
AutomatedTestercommented, Mar 4, 2021

The main reason that this if failing is that we need to use fs to be able to do manipulations on the disk for things like upload.

We would need to go through all the code to see where this is directly needed as I am sure a lot of it is down to legacy reasons. There are genuine reasons why we need to use fs like checking the driver executables are accessible so I don’t think we can action this bug.

Thanks for letting us know about it though.

0reactions
c0ncentuscommented, Mar 5, 2021

got some news :

https://www.npmjs.com/package/react-reconciler (link to reactJS …) from https://github.com/koba04/react-fs

maybe i got none feedback from reactjs, I will wait few days more…

Read more comments on GitHub >

github_iconTop Results From Across the Web

i get undefined when i run node js code while trying to read a ...
I think I made a mistake in the name of the file, now it's working perfectly. [Error: ENOENT: no such file or directory, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found