Giter Club home page Giter Club logo

Comments (20)

issue-label-bot avatar issue-label-bot commented on August 23, 2024 1

Issue-Label Bot is automatically applying the label bug to this issue, with a confidence of 0.82. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

from cypress-react-selector.

abhinaba-ghosh avatar abhinaba-ghosh commented on August 23, 2024

@dmlogs can you share the actual error message or the screenshot?

@nickpalmer may be interested in this as per the recent changes #90

from cypress-react-selector.

abhinaba-ghosh avatar abhinaba-ghosh commented on August 23, 2024

@nickpalmer Can you check whether 2.2.1 build really making a noise for the require.resolve ?

from cypress-react-selector.

raymiS avatar raymiS commented on August 23, 2024

@abhinaba-ghosh hello, I've been having the same error when I tried to import "cypress-react-selector"; and then do a

beforeEach(() => { cy.waitForReact(); ... });

inside support/index.js

Screen Shot 2020-11-24 at 3 36 35 PM

from cypress-react-selector.

dmlogs avatar dmlogs commented on August 23, 2024

@abhinaba-ghosh - sorry, I didn't include because it doesn't provide much additional context to what I put in the ticket, happy to provide additional info as well 👍

require-resolve-is-not-a-function

from cypress-react-selector.

abhinaba-ghosh avatar abhinaba-ghosh commented on August 23, 2024

By looking into this, it seems the problem is really happening for a subset of users. Can be a system configuration issue.

from cypress-react-selector.

maga-polito avatar maga-polito commented on August 23, 2024

Hi, If it helps it's happening to me too, only when running my project on docker

from cypress-react-selector.

maga-polito avatar maga-polito commented on August 23, 2024

Recent PR breaks the selector on MAC and linux, had to go back to version 2.2.0. to fix it.

from cypress-react-selector.

dmlogs avatar dmlogs commented on August 23, 2024

I'm not an expert JS developer so take what I say with a grain of salt

Something like below might work to resolve. Theory on the below is that typeerror only seems to happen from the execution at run time so if it can be bypassed. I would still be hesitant to tap in to the node_modules folder by path name.

const file = require?.resolve && typeof require?.resolve === 'function' ? require.resolve('resq') : 'node_modules/resq/dist/index.js';

Side Note: I've actually moved away from my previous use case for leveraging cypress-react-selector in favor of a simpler mechanism for the behavior I was looking to test that does not require tapping in to the React DOM - otherwise I'd implement and test the above myself, but hopefully someone else can pick it up

from cypress-react-selector.

0xIslamTaha avatar 0xIslamTaha commented on August 23, 2024

@abhinaba-ghosh I can confirm it occurs with me too. I'm using Ubuntu 20.01 and Cypress 4.12.0. I had to install V 2.2.0 to solve it.
image

from cypress-react-selector.

abhinaba-ghosh avatar abhinaba-ghosh commented on August 23, 2024

@0xIslamTaha is it also happening with the latest version of cypress-react-selector? Can you confirm?

from cypress-react-selector.

nickpalmer avatar nickpalmer commented on August 23, 2024

require.resolve was add in node version v0.3.0:
https://nodejs.org/api/modules.html#modules_require_resolve_request_options

The only reason I can think that it would not exist is that you are running on a very old version of node.

That said we have moved away from cypress-react-selector, but the code suggested by @dmlogs above should work in versions of node missing require.resolve.

from cypress-react-selector.

abhinaba-ghosh avatar abhinaba-ghosh commented on August 23, 2024

Thanks @nickpalmer and @dmlogs , the suggested code is deployed to v2.3.4

from cypress-react-selector.

0xIslamTaha avatar 0xIslamTaha commented on August 23, 2024

require.resolve was add in node version v0.3.0:
https://nodejs.org/api/modules.html#modules_require_resolve_request_options

The only reason I can think that it would not exist is that you are running on a very old version of node.

That said we have moved away from cypress-react-selector, but the code suggested by @dmlogs above should work in versions of node missing require.resolve.

@nickpalmer here is my running node

$ node -v
v14.15.1

from cypress-react-selector.

0xIslamTaha avatar 0xIslamTaha commented on August 23, 2024

Thanks @nickpalmer and @dmlogs , the suggested code is deployed to v2.3.4

Thanks man, 2.3.4 is working fine.

from cypress-react-selector.

nickpalmer avatar nickpalmer commented on August 23, 2024

We don't use typescript but apparently it uses a custom implementation of resolution. Telling it to use Node's version via --moduleResolution node might fix it but v2.3.4 should work in both situations.

TypeScript's replacement is breaking Node's API contract of offering require.resolve and they really should add a .resolve to their implementation so as not to break the API Node offers.

See:
https://www.typescriptlang.org/docs/handbook/module-resolution.html

from cypress-react-selector.

nickpalmer avatar nickpalmer commented on August 23, 2024

Issue filed with TypeScript so hopefully they will stop breaking the Node API at some point with their override.

from cypress-react-selector.

abhinaba-ghosh avatar abhinaba-ghosh commented on August 23, 2024

Great input @nickpalmer . Thanks for letting us know.

from cypress-react-selector.

garyshrimpling-rs avatar garyshrimpling-rs commented on August 23, 2024

The implemented fix breaks my setup with the same syntax problem as #128. I have made this hack to get running (although I could just call require.resolve without testing it since the property does exist).

const file = require.hasOwnProperty('resolve') ? require.resolve('resq') : 'node_modules/resq/dist/index.js';

node v14.15.4, cypress-react-selector v2.3.4, typescript v4.1.3 in my project. On Windows.

from cypress-react-selector.

abhinaba-ghosh avatar abhinaba-ghosh commented on August 23, 2024

Hi @gshrimpling67, a patch release is made v.2.3.5. Let me know if that solves the issue for your case.

from cypress-react-selector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.