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

Out of memory with tailwind ui #168

Closed
posva opened this issue May 17, 2020 · 1 comment · Fixed by #169
Closed

Out of memory with tailwind ui #168

posva opened this issue May 17, 2020 · 1 comment · Fixed by #169

Comments

@posva
Copy link
Contributor

posva commented May 17, 2020

Describe the bug

Running vite hangs for a moment and ends up crashing with a JavaScript heap out of memory

Reproduction

The problem happens by only adding the dependencies:

yarn create vite-app vite-bug-report
cd vite-bug-report
yarn add tailwindcss @tailwindcss/ui
yarn dev

System Info

  • vite version: 0.15.3
  • Operating System: OSX 10.15.4
  • Node version: v12.16.1
  • Latest vue@next

Logs (Optional if provided reproduction)

$ vite --debug --force
vite v0.15.3
  vite:resolve (node_module entry) @tailwindcss/ui -> @tailwindcss/ui/index.js +0ms
  vite:resolve (node_module entry) vue -> vue/dist/vue.runtime.esm-bundler.js +1ms
[vite] Optimizable dependencies detected.
Pre-bundling them to speed up dev server page load...
  (this will be run only when your dependencies have changed)

<--- Last few GCs --->

[1184:0x10291f000]    91906 ms: Mark-sweep 2033.4 (2050.6) -> 2029.3 (2037.4) MB, 900.4 / 0.0 ms  (+ 504.2 ms in 123 steps since start of marking, biggest step 10.4 ms, walltime since start of marking 1422 ms) (average mu = 0.108, current mu = 0.069) fina[1184:0x10291f000]    91916 ms: Scavenge 2033.2 (2037.4) -> 2026.0 (2060.9) MB, 3.8 / 0.0 ms  (average mu = 0.108, current mu = 0.069) allocation failure


<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x100950919]
Security context: 0x2fa1967808d1 <JSObject>
    1: /* anonymous */(aka /* anonymous */) [0x2fa1044ef1b9] [/Users/posva/vite-bug-tailwind/node_modules/@rollup/plugin-node-resolve/dist/index.js:~403] [pc=0x3a85a98460af](this=0x2fa1457804b1 <undefined>)
    2: next [0x2fa1967a2f49](this=0x2fa1044ef629 <JSGenerator>,0x2fa1457804b1 <undefined>)
    3: _next(aka _next) [0x2fa1044ef3d1] [/Users/posva/vite-bug-t...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
@posva
Copy link
Contributor Author

posva commented May 17, 2020

Submitted #169 as a fix but I wonder how many other dependencies will have to be added to that list. I think since tailwind is on the list, tailwindui should be added too but I think some kind of protection would be better.

For anybody with a similar problem, the dependency can be excluded by creating a vite.config.js file with

module.exports = {
  optimizeDeps: {
    exclude: ['@tailwindcss/ui'],
  },
}

@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant