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

[rush] devextreme-reactive imports are undefined when application is running #4858

Open
AlisherAmonulloev opened this issue Aug 2, 2024 · 2 comments

Comments

@AlisherAmonulloev
Copy link

In this monorepo there are two projects
business-component
template-sample.

The business-component project implements the TestGrid component which renders the Grid component from the devextreme-reactive package ( this guide ).
The template-sample project imports and renders the TestGrid component.

When the template-sample project is served, all the devextreme imports in the business-component are undefined. The browser's console shows:

react-jsx-runtime.development.js:87 Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check the render method of `TestGrid`.
    at TestGrid
    at App

Summary

Repro Steps

  1. Clone this repository.
  2. Execute rush update.
  3. Execute rush install.
  4. Execute rush build.
  5. Navigate to the ./packages/template-sample directory.
  6. Start the application with npm start.

TestGrid should be displayed when the application starts

Actual result:
The web page is empty and the browser console shows the following errors:

react-jsx-runtime.development.js:87 Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check the render method of `TestGrid`.
    at TestGrid
    at App
printWarning @ react-jsx-runtime.development.js:87Understand this error
react-dom.development.js:28439 Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check the render method of `TestGrid`.
    at createFiberFromTypeAndProps (react-dom.development.js:28439:1)
    at createFiberFromElement (react-dom.development.js:28465:1)
    at reconcileSingleElement (react-dom.development.js:15750:1)
    at reconcileChildFibers (react-dom.development.js:15808:1)
    at reconcileChildren (react-dom.development.js:19167:1)
    at updateHostComponent (react-dom.development.js:19924:1)
    at beginWork (react-dom.development.js:21618:1)
    at HTMLUnknownElement.callCallback (react-dom.development.js:4164:1)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:4213:1)
    at invokeGuardedCallback (react-dom.development.js:4277:1)Understand this error
react-dom.development.js:18687 The above error occurred in the <div> component:

    at div
    at http://localhost:3000/static/js/bundle.js:1458:66
    at Paper (http://localhost:3000/static/js/bundle.js:2921:83)
    at TestGrid
    at App

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.

Details

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/rush globally installed version? 5.130.3
rushVersion from rush.json? 5.76.1 (also tried 5.130.3)
useWorkspaces from rush.json? true
Operating system? Mac (also tried Windows)
Would you consider contributing a PR? No
Node.js version (node -v)? 20.14.0
@iclanton
Copy link
Member

iclanton commented Aug 5, 2024

It sounds like one of your dependencies has an undeclared dependency. I'm not familiar with your toolchain or with the dependencies you're using, but this very likely isn't a Rush issue.

@iclanton
Copy link
Member

iclanton commented Aug 5, 2024

Couple notes:

  • Your test repo has an unnecessary package-lock.json in its root
  • If your lockfile is already up-to-date, your devs shouldn't need to run rush update and rush install. Also note that rush update performs an install, so the rush install step is effectively a no-op.
  • I know you noted that you tried v5.130.3, but your repo is on a very old version of Rush, and PNPM v6.7.1 is also pretty old at this point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Waiting for Author
Development

No branches or pull requests

2 participants