Typescript: Change worker memory limit

Created on 10 Jul 2019  路  9Comments  路  Source: nuxt/typescript

When I run nuxt build I see Using 1 worker with 2048MB memory limit
How to set limit as 512MB? My server has only 1GB RAM and it breaks the server.

This question is available on Nuxt community (#c9475)
transfered

Most helpful comment

For others; after migrating to @nuxt/typescript-build, associated properties should be given to the module called @nuxt/typescript-build in the config file as below;

// nuxt.config.ts

export default config: Configuration {
  buildModules: [
    ['@nuxt/typescript-build', {
      typeCheck: {
        memoryLimit: 4096,
        workers: 2
      },
      ignoreNotFoundWarnings: false
    }]
  ]
}

All 9 comments

This issue as been imported as question since it does not respect nuxt.js issue template. Only bug reports and feature requests stays open to reduce maintainers workload.
If your issue is not a question, please mention the repo admin or moderator to change its type and it will be re-opened automatically.
Your question is available at https://cmty.app/nuxt/nuxt.js/issues/c9475.

/cc @kevinmarrec

@JILeXanDR

https://nuxtjs.org/api/configuration-build#typescript-typecheck
https://github.com/TypeStrong/fork-ts-checker-webpack-plugin#options => memoryLimit

// nuxt.config.js

export default {
  build: {
    typescript: {
      typeCheck: {
        memoryLimit: 512
      }
    }
  }
}

Please close the issue if it went fine for you 馃槈

For others; after migrating to @nuxt/typescript-build, associated properties should be given to the module called @nuxt/typescript-build in the config file as below;

// nuxt.config.ts

export default config: Configuration {
  buildModules: [
    ['@nuxt/typescript-build', {
      typeCheck: {
        memoryLimit: 4096,
        workers: 2
      },
      ignoreNotFoundWarnings: false
    }]
  ]
}

I report that @barinali mentioned causes twice type check (or just only showing up? idk)
SnapCrab_NoName_2020-4-10_10-23-2_No-00

@rikusen0335 If you manually setup 2 workers I think that's why you get double output.

@kevinmarrec No it's not. If I decrease workers to 1 or just remove that option I get 2 outputs.

@rikusen0335 I think you have something wrong in your configuration then, the type checker is configured to only run on Client, it won't be run at Server or Modern Client step.

Are you using Nuxt programatically ?

@kevinmarrec I am very sorry, I was writing the module @nuxt/typescript-build twice in buildModules 馃槀
Thank you for your information!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sambowler picture sambowler  路  3Comments

negezor picture negezor  路  6Comments

andrewvasilchuk picture andrewvasilchuk  路  4Comments

e-lobo picture e-lobo  路  4Comments

FreekVR picture FreekVR  路  4Comments