V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Turkestan
V2EX  ›  Next.js

Nextjs 14.1.0 项目 OOM 有人遇到过吗

  •  
  •   Turkestan · Feb 9, 2024 · 3905 views
    This topic created in 810 days ago, the information mentioned may be changed or developed.
    8G RAM 会挂,App 和 Page Folder 同时使用,没想到怎么复现

    yarn build 就会失败,不知道有没有老哥遇到过这种情况,怎么查看是在 build 哪个文件失败的

    webpack v5
    14 replies    2024-02-12 05:04:02 +08:00
    estk
        1
    estk  
       Feb 9, 2024 via iPhone   ❤️ 1
    干嘛还用 page folder ,顶部加个 use client 不就可以了?
    Turkestan
        2
    Turkestan  
    OP
       Feb 9, 2024
    @estk 老项目迁移
    june4
        3
    june4  
       Feb 9, 2024
    jemalloc 可以省很多 node 内存
    estk
        4
    estk  
       Feb 9, 2024
    @Turkestan #2
    除非重构,不然没必要升级 next 版本
    Turkestan
        5
    Turkestan  
    OP
       Feb 9, 2024
    @estk 你猜对了,单就 TS error ,我就改了几百个文件
    estk
        6
    estk  
       Feb 9, 2024
    @Turkestan #5
    如果你时间宽裕,可以慢慢搞,商业可不等技术
    wukongkong
        7
    wukongkong  
       Feb 9, 2024
    @estk build 失败,然后本地都运行不起来。在配置文件,忽略 ts 还有 eslint 错误,然后正常编译出来。

    eslint: {
    ignoreDuringBuilds: true,
    },
    typescript: {
    ignoreBuildErrors: true,
    },
    wukongkong
        8
    wukongkong  
       Feb 9, 2024
    和内存没啥关系,就是这些错误导致的,仔细看编译的内容
    ericguo
        9
    ericguo  
       Feb 9, 2024
    我在用.next 14.1 ,不过我全部转到 app router 了,而且是很简单的项目,所以没有看到 OOM
    Turkestan
        10
    Turkestan  
    OP
       Feb 10, 2024
    @estk 俺们公司项目,挂半个月了
    Turkestan
        11
    Turkestan  
    OP
       Feb 10, 2024
    @wukongkong 这个试过了,哪怕 ts 设置为 transpile only 也不行

    也没啥报错,显示 memory 不足,Signal Killed
    Turkestan
        12
    Turkestan  
    OP
       Feb 10, 2024
    @ericguo 俺们现在没法复现,所以不知道问题出在哪里
    zk8080
        13
    zk8080  
       Feb 10, 2024
    我这边新项目 app router ,构建没报错,但是访问量多了就会 oom ,也不知道怎么查😭
    cheunghy
        14
    cheunghy  
       Feb 12, 2024
    其实很可能是内存泄露造成的,next13/14 的 app 其实几乎是重写的框架了,和过去的 pages ,用法上不像一个框架。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1007 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 18:59 · PVG 02:59 · LAX 11:59 · JFK 14:59
    ♥ Do have faith in what you're doing.