Currently you need `MORALIS_APPLICATION_ID` and `MORALIS_SERVER_ID` for nextjs
See original GitHub issueNew Feature Request
Checklist
- I am not disclosing a vulnerability.
- I have searched through existing issues and the Moralis Forum.
Current Limitation
Right now, users have to get an appId and ServerId to use moralis, it would be great if this wasn’t the case.
Steps to reproduce:
npx create-next-app
- npm install react-moralis
- Go to
_app.js
and make the file look like:
import '../styles/globals.css'
import { MoralisProvider } from "react-moralis";
const moralisAppId = process.env.MORALIS_APPLICATION_ID || "xxxxxxxx"
const moralisServerId = process.env.MORALIS_SERVER_ID || "xxxxxxxx"
function MyApp({ Component, pageProps }) {
return (
<MoralisProvider appId={moralisAppId} serverUrl={moralisServerId}>
<Component {...pageProps} />
</MoralisProvider>
)
}
export default MyApp
- Run
npm run dev
You’ll get a wonderful error on the site after a refresh. However, if you add the appId and serverURL, this works fine.
Feature / Enhancement Description
The idea is to make it so that it can render ever without the appId and serverUrl, this way, someone could always use moralis even if they didn’t make a server.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Next.js by Vercel - The React Framework
Next.js gives you the best developer experience with all the features you need for production: hybrid static & server rendering, TypeScript support, ...
Read more >Deployment
Congratulations, you are ready to deploy your Next.js application to production. This document will show how to deploy either managed or self-hosted using...
Read more >How Next.js Works | Learn Next.js
In the next sections, we'll look at what happens to your application code during these different stages: The environment where your code runs:...
Read more >Blog - Next.js 13
Today, we're improving the routing and layouts experience in Next.js and aligning with the future of React with the introduction of the app ......
Read more >Advanced Features: Next.js Compiler
Compilation using the Next.js Compiler is 17x faster than Babel and enabled by default since Next.js version 12. If you have an existing...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Been playing around with it for some time, and it’s amazing!! Exactly what I was thinking.
EXCITED TO TRY