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

FATAL Intl.Segmenter is not a constructor with Node 14 #204

Closed
dockleryxk opened this issue Jun 27, 2023 · 12 comments
Closed

FATAL Intl.Segmenter is not a constructor with Node 14 #204

dockleryxk opened this issue Jun 27, 2023 · 12 comments

Comments

@dockleryxk
Copy link

dockleryxk commented Jun 27, 2023

Environment

Node 14.12.4, trying to build a Nuxt 2 project

Reproduction

Unfortunately, this is a private repo

Describe the bug

Build a Nuxt 2 project on Node 14 using consola v3.2.x – get this fatal error.

If I can provide more context, please let me know, but this seems cut and dry.

I did not try other Node versions

Additional context

When forcing consola v3.1.x, there is no issue

Logs

12:48:36
   FATAL  Intl.Segmenter is not a constructor
12:48:36
  
12:48:36
    at stringWidth (node_modules/@nuxt/cli/node_modules/consola/dist/shared/consola.2a3942ff.cjs:464:37)
12:48:36
    at FancyReporter.formatLogObj (node_modules/@nuxt/cli/node_modules/consola/dist/shared/consola.2a3942ff.cjs:585:41)
12:48:36
    at FancyReporter.log (node_modules/@nuxt/cli/node_modules/consola/dist/shared/consola.deac7d5a.cjs:53:23)
12:48:36
    at Consola._log (node_modules/@nuxt/cli/node_modules/consola/dist/core.cjs:383:16)
12:48:36
    at resolveLog (node_modules/@nuxt/cli/node_modules/consola/dist/core.cjs:351:14)
12:48:36
    at Consola._logFn (node_modules/@nuxt/cli/node_modules/consola/dist/core.cjs:379:5)
12:48:36
    at Consola.fatal (node_modules/@nuxt/cli/node_modules/consola/dist/core.cjs:308:19)
12:48:36
    at NuxtCommand.run (node_modules/@nuxt/cli/dist/cli-index.js:366:17)
@wilhantian
Copy link

me too...

@maxJeongCC
Copy link

me too..too!

@pi0 pi0 changed the title FATAL Intl.Segmenter is not a constructor FATAL Intl.Segmenter is not a constructor with Node 13 Jun 28, 2023
@pi0 pi0 changed the title FATAL Intl.Segmenter is not a constructor with Node 13 FATAL Intl.Segmenter is not a constructor with Node 14 Jun 28, 2023
@pi0
Copy link
Member

pi0 commented Jun 28, 2023

Hi. This is an incompatibility with Node.js 14 (which is EOL since April). Please consider upgrading your Runtime Node.js to 16+. (This comes from string-width@6)

As a workaround if you cannot upgrade Node version, you can set CI=1 environment variable.

@pi0 pi0 closed this as completed in 2e72913 Jun 28, 2023
@pi0
Copy link
Member

pi0 commented Jun 28, 2023

3.2.2 has a workaround for Node 14 backward compatibility (https://github.com/unjs/consola/releases/tag/v3.2.2)

@dockleryxk
Copy link
Author

@pi0 thank you for adding this workaround – I'm sure it's annoying supporting an EOL version but it's very much appreciated!

@jk-soul
Copy link

jk-soul commented Dec 20, 2024

3.2.2 has a workaround for Node 14 backward compatibility (https://github.com/unjs/consola/releases/tag/v3.2.2)

show again in 3.30 :)

@xiaoyierle
Copy link

show again in 3.2.3

@xiaoyierle
Copy link

In the nuxt2.14.0 version, the 3.2.3 version of Consola was referenced, which caused the failure to start successfully in Node 14. Can you help to handle compatibility with this version?

@fenn1ks
Copy link

fenn1ks commented Dec 23, 2024

in 3.3.3 version again this problem, all project crash

@pi0
Copy link
Member

pi0 commented Dec 23, 2024

#326 / v3.1.1 adds fallback for Intl, however, please consider that Node.js 14 is long time EOL and there is no guarantee consola won't break again on unsupported node versions. Please consider upgrading ASAP to a supported version.

@chenyinshi
Copy link

Hello, I am using Node v14.21.2. The project was previously using consola v3.2.3, which worked fine, but after upgrading to v3.3.0 yesterday, I encountered the error 'FATAL Intl.Segmenter is not a constructor'. I have upgraded to v3.3.1, but the same issue persists.

@xiaoyierle
Copy link

xiaoyierle commented Dec 26, 2024

My project is based on node 14.19.1 version and uses npm i to pull dependencies, using the nuxt 2.14.0 framework
After pulling the code, it is necessary to modify the folder 'node_comodules/@ nuxt'

node_modules/@nuxt/utils/node_modules/consola
node_modules/@nuxt/config/node_modules/consola
node_modules/@nuxt/cli/node_modules/consola
node_modules/@nuxt/core/node_modules/consola
node_modules/@nuxt/server/node_modules/consola
node_modules/@nuxt/vue-renderer/node_modules/consola
node_modules/@nuxt/telemetry/node_modules/consola
node_modules/@nuxt/builder/node_modules/consola
node_modules/@nuxt/webpack/node_modules/consola
node_modules/webpackbar/node_modules/consola

The 'consola' version in the code will report an error if it is' 3.2.3 'and needs to be downgraded to' 3.2.2 '`
The downgrade method is to replace all files in the 'node_modules/consola' folder with the version number in the above folder, which can be viewed in 'package. json'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants