When trying to import web3uikit, the next application throws an error Module not found. I tried uninstalling and installing the package again, but it's not working. My package.json also has the dependency, but the error still exists.
I don't know why this is happening, I even tried restarting the development server, but nothing changed. Can anyone please help me understand why this error is happening and how I can resolve it?
import {ConnectButton} from 'web3uikit'
import React from 'react'
const Sidebar = () => {
return (
<div>
<ConnectButton />
</div>
)
}
export default Sidebar
was encountering the same error, turns out i have to install this very specific version "^0.1.159"
use :
npm i web3uikit#^0.1.159
Related
I am running Next.js 13.0.5 with Yarn 3.2.1 and Lerna 5.6.1.
It seems like the main problem here is the build tool, because when I run the Next.js server itself (yarn dev) everything works perfectly.
What error am I getting?
Type error: Cannot find module 'next/app' or its corresponding type declarations.
which happens here right at the start of the program
import type { AppProps } from 'next/app'
^
function MyApp({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
}
After looking around I tried some experimental features like swcFileReading : false
but it doesn't seem to have any effect.
try:
yarn dlx #yarnpkg/sdks vscode
Then you don't need to fallback to nodeLinker: node-modules as other StackOverflow suggestions to this problem. It resolved for me!
for more info check the yarn/ts issue: https://github.com/yarnpkg/berry/issues/4872#issuecomment-1284318301
I am using yup and react-hook-form for one of my modals, everything works, but when I refresh the page the app crashes and I see this error:
Error: Package subpath './yup/dist/yup' is not defined by "exports" in /Users/rips/Desktop/myapp-next rules/node_modules/#hookform/resolvers/package.json
This error happened while generating the page. Any console logs will be displayed in the terminal window.
these are my imports
import { yupResolver } from "#hookform/resolvers/yup/dist/yup";
import * as yup from "yup";
What could be the issue here?
Try to downgrading the node version.
First install nvm from here.
Then install 16.15.1 (current version is 18.5)
Then use nvm use 16.15.1 and then try to build the project.
I keep getting this error when trying to build my app on Vercel, while it works locally without problems.
Here is the error message
Cannot find module Type error: Cannot find module './sidenav/SideNav' or its corresponding type declarations.
At this line
import SideNav from "./sidenav/SideNav"
While import this works fine in the same component
import NavigationBar from "./navigationBar/NavigationBar"
My SideNav is nothing special
const SideNav = () => {
return (
<>
<div></div>
</>
);
};
export default SideNav;
Any idea on what the problem could be?
I was facing this issue too. After initial commit, I renamed a folder from ./src/Provider to ./src/provider making my Github builds fail. Clearing my git cache and re-committing somehow fixed the problem.
git rm --cached -r .
After some testing, changing the folder to ./sideNav/SideNav instead of ./sidenav/SideNav works even if the initial import naming was correct in the name
The error maybe also because of the OS you are using.
E.g, if using mac, folder and file names are case-insensitive, so if you are not using the same case as the file, it will work fine locally, but when you deploy it to vercel, case causes the problem.
Now I am making an app in react native.
A Few days ago, I needed to use Modal in my app so I have installed "react-native-modalbox".(https://github.com/maxs15/react-native-modalbox)
But after that, I got Warning like the image below.
I couldn't get this mean and a way to solve this.
I see this warning as simply a warning that does not affect the code.
This would be simply a Metro warning.
But if you want to get rid of this,
import { YellowBox } from "react-native";
YellowBox.ignoreWarnings(["Require cycle:", "Remote debugger"]);
I hope you to refer to this.
OR
I Referenced this link
Add a scripts folder in your project
Create a stfu.js file with the following content
const fs = require('fs');
const codeToObscure = /console.warn\([\s\S].*"Require cycle: "/;
const problemFilePath = './node_modules/metro/src/lib/polyfills/require.js';
const problemFileContent = fs.readFileSync(problemFilePath,'utf8');
fs.writeFileSync(problemFilePath,problemFileContent.replace(codeToObscure,'const noConsoleWarn = (""'),'utf8');
Add the following line to your package.json in your scripts : "postinstall": "node ./scripts/stfu.js",
When it's done, just rm -rf node_modules && yarn to reinstall everything, and make sure these damn warnings are now gone.
I hope these methods work for you.
IntelliJ IDEA started highlighting errors in some of my import statements that worked previously. This is not unexpected as net.corda.finance is still in the "incubating" stage.
I am working in Java.
Corda Release: 3.3
Noticed this change on github: https://github.com/corda/corda/pull/4700
So I made what I thought are the necessary changes...
//Old
//import static net.corda.finance.utils.StateSumming.sumCashBy;
//New
import static net.corda.finance.contracts.utils.StateSumming.sumCashBy;
...but I'm still getting an error. I am sure I must be overlooking something simple.
#Kid101 put me on the right track by trying StateSumming.sumCashBy(contractState)
Once I did that IntelliJ recognized I needed to add:
net.corda:corda-finance:3.3-corda
...to the classpath. If I allowed IntelliJ to add it from the context menu the error reappeared every time gradle refreshed. So I added:
cordaCompile "$corda_release_group:corda-finance:$corda_release_version"
...to the build.gradle file under the dependencies section. No more errors with my import statement:
import net.corda.finance.utils.StateSumming;
...and no issues calling the sumCashBy method.
The change you mention is in Corda master branch, In CashTests.kt you can see how sumCashBy is imported, import net.corda.finance.contracts.utils.sumCashBy.
In corda/release-V4-branchpoint import is still net.corda.finance.utils.sumCashBy i.e. the change has not made in yet to V4.
Try to build the project again.
If using Java, try: StateSumming.sumCashBy(contractState)
You should import a dependency package.
You add below to build.gradle and refresh your IntelliJ project.
dependencies {
....
cordaCompile "$corda_core_release_group:corda-finance-contracts:$corda_core_release_version"
...