Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.6.X打包是在rendering chunks 卡住 #5597

Closed
7 tasks done
1770301860 opened this issue Nov 9, 2021 · 23 comments
Closed
7 tasks done

v2.6.X打包是在rendering chunks 卡住 #5597

1770301860 opened this issue Nov 9, 2021 · 23 comments
Labels
bug: upstream Bug in a dependency of Vite has workaround

Comments

@1770301860
Copy link

Describe the bug

使用2.6.x版本打包时 在 rendering chunks 卡住 内存占用突然变得很高 然后就降低了 然后一直卡住
image

Reproduction

。。。

System Info

。。。。

Used Package Manager

npm

Logs

No response

Validations

@github-actions
Copy link

github-actions bot commented Nov 9, 2021

Hello @1770301860. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with need reproduction will be closed if they have no activity within 3 days.

@P-der
Copy link

P-der commented Nov 9, 2021

mark

@sanyuan0704
Copy link
Contributor

可以给个例子复现下吗?

@lincenying
Copy link

升级完之后, 我的也卡住了, 原因是用element-ui, 如果你也用了element-ui, 或者element-plus的话, 手动把node_modules/element-ui/lib/theme-chalk/*.css 里的@charset "UTF-8";删了

@P-der
Copy link

P-der commented Nov 10, 2021

可以给个例子复现下吗?
https://github.com/P-der/vite-build 我尝试创建了一个,你可以试一下

@shigma
Copy link
Contributor

shigma commented Nov 11, 2021

我这也确实出现了这种问题。

@BinGarfield
Copy link

lQLPDhrZ6iC4bDnMt80B3LDL_lVI8kxilwGSRiWRgAcA_476_183
I have the same problem here....
system: centos 7, 8G
the development environment is normal, but it gets stuck when you build...

@BinGarfield
Copy link

image
package.json

@kensmaster
Copy link

lincenying说的对

@junbinding
Copy link

暂时还原到 2.5.10 吧

@iamiota
Copy link

iamiota commented Dec 6, 2021

Configuring this can temporarily solve the memory problem

export default defineConfig({
  css: {
    preprocessorOptions: {
      scss: {
        charset: false
      }
    }
  }
})

element-plus/element-plus#3219 (comment)

@ErHu1993
Copy link

ErHu1993 commented Dec 7, 2021

Configuringminify: false in build can temporarily solve

export default defineConfig({
  css: {
    preprocessorOptions: {
      scss: {
        charset: false
      }
    }
  },
  build: {
    minify: false
  }
})

@alvinindra
Copy link

Configuringminify: false in build can temporarily solve

export default defineConfig({
  css: {
    preprocessorOptions: {
      scss: {
        charset: false
      }
    }
  },
  build: {
    minify: false
  }
})

But your script will bigger size and we need to minify it

@ErHu1993
Copy link

ErHu1993 commented Dec 7, 2021

Yes, its not the best way 🙁

@john-keith
Copy link

the same question i've met 🙁

@menghany
Copy link

menghany commented Dec 8, 2021

the same question when i use ant design vue 3.x

@john-keith
Copy link

the same question when i use ant design vue 3.x

yesterday i degrade the vite's version to 2.5.x without this problem yet

@menghany
Copy link

menghany commented Dec 8, 2021

the same question when i use ant design vue 3.x

yesterday i degrade the vite's version to 2.5.x without this problem yet

I also temporarily reverted to the 2.5.10

@alvinindra
Copy link

the same question when i use ant design vue 3.x

yesterday i degrade the vite's version to 2.5.x without this problem yet

I also temporarily reverted to the 2.5.10

I solve the problem with this. This is ignore the charset problem. #5833

  css: {
    postcss: {
      plugins: [
          {
            postcssPlugin: 'internal:charset-removal',
            AtRule: {
              charset: (atRule) => {
                if (atRule.name === 'charset') {
                  atRule.remove();
                }
              }
            }
          }
      ],
    },
}

@lincenying
Copy link

lincenying commented Dec 9, 2021

postcss.config.js

var charsetRemoval = () => {
    return {
        postcssPlugin: 'internal:charset-removal',
        AtRule: {
            charset: atRule => {
                if (atRule.name === 'charset') {
                    atRule.remove()
                }
            }
        }
    }
}

module.exports = () => {
    return {
        plugins: [
            //其他postcss插件,
            charsetRemoval()
        ]
    }
}

直接放vite.config.js里好像和postcss.config.js有冲突, 导致postcss.config.js里的插件不生效

@gluck
Copy link
Contributor

gluck commented Dec 20, 2021

FYI as per evanw/esbuild#1862 upgrading to esbuild 0.14.6 fixed this for me (charset removal config no longer required)

@xiangqunXiao
Copy link

你可以分享你完整的 postcss 配置和 vite 配置吗?我试了还是无效

@sapphi-red
Copy link
Member

Closing as it seems there was a bug in esbuild which is now fixed. #5597 (comment)

@github-actions github-actions bot locked and limited conversation to collaborators May 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug: upstream Bug in a dependency of Vite has workaround
Projects
None yet
Development

No branches or pull requests