Show previous messages
November 7, 2019 at 3:16pm
November 8, 2019 at 5:26pm
I need some help
I created build and copied .next, package.json, server.js, next.config.js Then I run npm install and then npm run start 'start': 'node server.js' But I am getting this error Error: ENOENT: no such file or directory, scandir '/home/pratyakash/Documents/crezot/try/pages'
November 10, 2019 at 7:22pm
Hi guys, I need some help. I’m building a SSR Web App with Next.js and Express as the server. I’m trying to figure out how to persist data among the different routes, that point to different pages. The idea is to pass global data from the server and inject it in a sort of "wrapper". I see that there is a possibility to extend _app.js but I red that this has some cons. From the docs: // Only uncomment this method if you have blocking data requirements for // every single page in your application. This disables the ability to // perform automatic static optimization, causing every page in your app to // be server-side rendered. What do you think about this? Thanks
November 11, 2019 at 1:42pm
Hi everyone. I'm seeing a really weird behaviour on my nextjs app. I don't know if i'm missing something or if it is a bug. You can reproduce this using the
npx create-next-appso i think is not something with my configuration.
If you add something like this
The server side output will be
The client code will then fix this mismatch render but the server side render is wrong.
If you add a
span(instead of a
address) this does not happen but if you add a
div(I know you should not add in a
p, this is only for reproduce the problem xD) happen too.
Do you have any idea if something is missing me or if this is a bug?
November 11, 2019 at 8:04pm
P can't contain any block elements, like div. This is normal behaviour:
The P element represents a paragraph. It cannot contain block-level elements (including P itself).
from w3 site
I mostly depend what params do you need to share between page. If this is just one time operation on server side that needs to be share across whole app then use _app.js and pass it to props, but anyway. Why passing something in _app.js and not use redux ?
Happy to be amongst you
btw. is there any way to reset my point in tutorial? I know it means nothing but it makes me feel bad that I checked the wrong answer
ussually a html is displayed correctly no matter if is valid. In client side works right? XD the div was give by example as i now that cannot be used. But readding the w3 again i notice that i mistake address. Address is a flow content and that is the reason why cannot be used in p. I thought wanst a flow one. But no mattet what i do not see why the render of invalid html is diffetent in server or on client. Should be thr same right?
November 12, 2019 at 8:21am
November 12, 2019 at 2:37pm
November 12, 2019 at 8:45pm
Hi folks. How would I load a self-hosted font in Next? In Gatsby I'd normally find a font here: https://github.com/KyleAMathews/typefaces/ and
require()that font in the
gatsby-browser.jsfile. I'm guessing I'd have to do something with webpack in the
November 13, 2019 at 9:08am
November 13, 2019 at 7:59pm
Hello! Could anyone teach me how to setup environment variables correctly. I use a custom express server. My current config is every secret api key is kept in a .env file in the root of my project. I require the dotenv library on the index of my server. Every route is able to use them. However my Next.js 'frontend' can't seem to access the values of these environment values unless I keep some of them in the next.config.js file. How do I manage them in production?
November 14, 2019 at 6:26pm
RangeError: Invalid array length at __spreadArrays (C:\Users\Ismail\Downloads\Projects\nextjsapp\client.next\server\static\development\pages_error.js:16:18) at emitChange (C:\Users\Ismail\Downloads\Projects\nextjsapp\client.next\server\static\development\pages_error.js:433:52) at new class_1 (C:\Users\Ismail\Downloads\Projects\nextjsapp\client.next\server\static\development\pages_error.js:454:9) at processChild (C:\Users\Ismail\Downloads\Projects\nextjsapp\node_modules\react-dom\cjs\react-dom-server.node.development.js:3161:14) at resolve (C:\Users\Ismail\Downloads\Projects\nextjsapp\node_modules\react-dom\cjs\react-dom-server.node.development.js:3126:5) at ReactDOMServerRenderer.render (C:\Users\Ismail\Downloads\Projects\nextjsapp\node_modules\react-dom\cjs\react-dom-server.node.development.js:3600:22) at ReactDOMServerRenderer.read (C:\Users\Ismail\Downloads\Projects\nextjsapp\node_modules\react-dom\cjs\react-dom-server.node.development.js:3538:29) at renderToString (C:\Users\Ismail\Downloads\Projects\nextjsapp\node_modules\react-dom\cjs\react-dom-server.node.development.js:4247:27) at render (C:\Users\Ismail\Downloads\Projects\nextjsapp\node_modules\next\dist\next-server\server\render.js:81:16) at Object.renderPage (C:\Users\Ismail\Downloads\Projects\nextjsapp\node_modules\next\dist\next-server\server\render.js:322:20) at C:\Users\Ismail\Downloads\Projects\nextjsapp\client.next\server\static\development\pages_document.js:847:21 at step (C:\Users\Ismail\Downloads\Projects\nextjsapp\client.next\server\static\development\pages_document.js:45:23) at Object.next (C:\Users\Ismail\Downloads\Projects\nextjsapp\client.next\server\static\development\pages_document.js:26:53) at asyncGeneratorStep (C:\Users\Ismail\Downloads\Projects\nextjsapp\client.next\server\static\development\pages_document.js:217:24) at _next (C:\Users\Ismail\Downloads\Projects\nextjsapp\client.next\server\static\development\pages_document.js:239:9) at process._tickCallback (internal/process/next_tick.js:68:7) [ event ] build page: / [ wait ] compiling ...
someone can helpe me?
November 15, 2019 at 4:44pm
I need help demystifying what Next.js can or can't do with a static export build. I have a front-end only Next.js app with a route like,
/user/profile/:userId. It works if I
yarn run build && yarn run devand also if I
yarn run build && yarn run start(
next start -p $PORT. I can access the route and pass different ids in the url and access them at runtime. The IDs are NOT known in advance at build time. With export, I do
yarn run build && yarn run exportthen from the generated,
/outdir, I run a basic web server like
python -m SimpleHTTPServer 3000. From there, I can't access my user profile route and there is a
/test/[userId].htmlpage. Should it be possible to access
next exportstatic build?
November 18, 2019 at 1:08am
Can I ask why this example( https://github.com/zeit/next.js/blob/canary/examples/with-loading/pages/_app.js ) didn't place
componentDidMount? Document(https://github.com/zeit/next.js#router-events) written
Router events should be registered when a component mounts (useEffect or componentDidMount/componentWillUnmount) or imperatively when an event happens.but _app.js is only exception?
and we don't have to
Router.events.offin this case?