I am trying to import #material/ui core into a SSR React project. I have come across the following error.
node_modules#babel\runtime\helpers\esm\objectWithoutProperties.js:1
I feel like I am missing a dependency but not sure which to install.
Any suggestions on how to fix?
Thanks
I need to update the babel packages:
Specifically https://babeljs.io/docs/en/babel-runtime and
https://babeljs.io/docs/en/babel-helpers
Related
I'm working on a react project with typescript (set up with create-react-script).
Following the doc I've installed react-query with
yarn add #tanstack/react-query
But I keep getting the typescript error: Cannot find module '#tanstack/react-query' or its corresponding type declarations.
Any idea of what I might be missing ?
While I could downgrade to react-query v3 as suggested here, I'd rather have the v4 working.
Thanks for your help !
I tried
removing and reinstalling react-query
removing node_modules and re build my project
Conclusion to the story: I had misconfigured my docker compose volume. So, the package was installed in the container but not in local which explained the error in my IDE.
Sorry if I made someone loose his/her time and I hope it might still be of some use to others !
I am trying to integrate React-bootstrap into my SPFX project. I use the following versions.
React: 16.13.1
react-bootstrap: 2.4.0
SPFx: 1.14
When I try to import any react-bootstrap module into my tsx file, something like:
import Alert from 'react-bootstrap/Alert';
I get the error Cannot find module 'react/jsx-runtime'
Many forums tell me to upgrade my react version, but I cannot do so in my case, as latest version of SPFX (1.14) supports React 16.13.1, and not higher version.
Any solution to overcome the above issue would be very helpful
I tried installing Tradingview's 'lightweight-charts' for react typescript but I can't seem to download the #types for this package because it does not show up on package.json. Therefore, unable to render my react app.
I have tried installing with npm and yarn but they both don't work
Can anyone please help me?
Where can I download the types for this package so it works? The npm repository says that it supports typescript.
thanks in advance!
As part of our package, we generate and provide types that can be found here (for instance).
In theory you shouldn't have to do anything to start working with Typescript as it should work out of the box
Hi Guys I'm trying to export a component with bit.dev but after several attempts I always get this error on the preview of the component and importing the component I always get error.
Module not found: Can't resolve 'react/jsx-runtime' in '/capsule/node_modules/#bit/giovannigiampaolo.testCollection.button/dist'
Can someone help me?
If this issue is in the typescript project then, we need to add tsconfig.json to the project.
Since we cannot follow the default folder structure of NodeJS, we shall need to create an environment for the workspace.
Reference Link: Bit Envs Overview
We can try to implement the way documented above.
Using this I got configurations of typescript, webpack, and jest.
The typescript folder contained the tsconfig.json file and we can edit it to our requirements.
Updating your React to the latest version will solve the issue; did it for me. Just do:
yarn add react#latest
and you're good.
I feel like I was finally able to setup my expo monorepo using expo-yarn-workspaces until I encountered the following error:
Invariant Violation: Hooks can only be called inside the body of a function component. (https:fb.me/react-invalid-hook-call)
Has anyone successfully created an expo monorepo working with react hooks?
I should also mention that the expo app was working perfectly with no-hoist until I needed to include other packages from the monorepo into it. So it seems the issue is now how yarn-expo-workspaces is not compatible with hooks, or am I missing something?