小编Cod*_*ody的帖子

如何构建 next.js 产品?

我尝试在 next.js 中获得生产版本以在我的服务器上运行它,但是当我尝试时我无法构建 next.js 生产版本

npm 运行构建

有谁知道如何让 next.js 中的 prod 构建正常工作我做了 next.js 文档中的所有内容,但总是在下面出现此错误。如果我做一个开发构建它工作得很好但是尝试生产构建会导致错误。

我也做了很多次next build并重新安装了所有仍然存在此错误的 node_modules 包。

它总是在终端显示我

Error: Could not find a valid build in the '/mnt/c/Users/NZXT_YOLO/Desktop/New folder (2)/learnnextjs-demo/.next' directory! Try building your app with 'next build' before starting the server.
    at Server.readBuildId (/mnt/c/Users/NZXT_YOLO/Desktop/New folder (2)/learnnextjs-demo/node_modules/next/dist/server/next-server.js:753:15)
    at new Server (/mnt/c/Users/NZXT_YOLO/Desktop/New folder (2)/learnnextjs-demo/node_modules/next/dist/server/next-server.js:80:25)
    at module.exports (/mnt/c/Users/NZXT_YOLO/Desktop/New folder (2)/learnnextjs-demo/node_modules/next/dist/server/next.js:6:10)
    at Object.<anonymous> (/mnt/c/Users/NZXT_YOLO/Desktop/New folder (2)/learnnextjs-demo/next.config.js:6:13)
    at Module._compile (internal/modules/cjs/loader.js:707:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
    at Module.load (internal/modules/cjs/loader.js:605:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
    at Function.Module._load …
Run Code Online (Sandbox Code Playgroud)

node.js reactjs next.js

8
推荐指数
2
解决办法
4万
查看次数

如何在 NEXT.js 中创建子页面

我尝试获取一些子页面,例如

  • example.com/tests/project1
  • example.com/tests/project2

在 nextjs https://nextjs.org/

我能够创建类似的页面

  • example.com/page1
  • example.com/page2

通过把这样的页面

page1.js

在页面“文件夹”中,但如何创建子页面,例如

  • example.com/tests/page1
  • example.com/tests/page2

我尝试的是在 Pages 文件夹中创建子文件夹,但这不起作用并输出错误。

非常感谢帮助

node.js reactjs react-native next.js

5
推荐指数
1
解决办法
7088
查看次数

CSS 循环渐变过渡

我有一个问题,我想创建一个 CSS 循环渐变动画,但是当我这样做时,动画是非常静态的,它不能流畅地动画 下面是我目前正在处理的示例。希望你能帮助我。

.slider1 {
  background: background: linear-gradient(rgba(173, 136, 255, 0.44), rgb(109, 0, 255)) !important;
}

/* css animation not smooth */
.slider1 {
  opacity: .5;
  animation: myfirst 5s;
  -moz-animation: myfirst 5s infinite; /* Firefox */
  -webkit-animation: myfirst 5s infinite; /* Safari and Chrome */
}

@-moz-keyframes myfirst { /* Firefox */ 
  0% {
    background: linear-gradient(rgba(173, 136, 255, 0.44), rgb(0, 174, 255))
  }
  50% {
    background: linear-gradient(rgba(173, 136, 255, 0.44), rgb(135, 255, 0))
  }
  100% {
    background: linear-gradient(rgba(173, 136, …
Run Code Online (Sandbox Code Playgroud)

html css css-animations css-gradients

3
推荐指数
1
解决办法
3521
查看次数

Javascript Convert Hours and Minutes into Days

I'm sorry if something similar might be discussed before, but I really need help with it.

Bellow is the code all I want to do is if the number goes over 24h it should switch to 1 day and 0 h, I can't figure it out if someone can please explain how to do it that would be so kind. I'm using it to calculate minutes and hours and want to have also days calculations if the number is higher …

javascript jquery jquery-calculation

2
推荐指数
1
解决办法
6499
查看次数