Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] fix(devtools-internal): fix NODE_ENV conditional didn't work #6030

Open
sanchezcarlosjr opened this issue Jun 10, 2024 · 2 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@sanchezcarlosjr
Copy link

sanchezcarlosjr commented Jun 10, 2024

Describe the bug

Hello,
@aliemir published the PR #5992 and it works. However, esbuild doesn't compile as expected. The compiler doesn't generate correctly as you write here


So, instead of

() => {
        return {};
      }

it generates

() => ({})

Steps To Reproduce

  1. Install @refinedev/devtools-internal or visit the link @refinedev/devtools-internal npm package code tab
  2. Check the below expression in index.cjs and index.mjs.
process.env.NODE_ENV!=="development" ? ()=>({})  : ...

Expected behavior

The below expression

process.env.NODE_ENV!=="development" ? ()=>({}): ...

must be something similar to

process.env.NODE_ENV!=="development" ? ()=> {
   return {};
}: ...

Probably adding a noop function helps.

const noop = () => {
   return {};
}

process.env.NODE_ENV!=="development" ? noop: ...

Packages

  • @refinedev/devtools-internal:1.1.11

Additional Context

No response

@sanchezcarlosjr sanchezcarlosjr added the bug Something isn't working label Jun 10, 2024
@aliemir
Copy link
Member

aliemir commented Jun 10, 2024

Hey @sanchezcarlosjr, thank you for explaining the issue here! 🙏 Did you encounter this issue while working with React Native or is there any other platform that has issues with parsing those lines? 🤔

@sanchezcarlosjr
Copy link
Author

sanchezcarlosjr commented Jun 10, 2024

Thank you for your answer, @aliemir. I'm working with traditional React web apps, and Refine works as expected. The issue only occurs in React Native as far as I know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants