Skip to content

Use nodejs 20 to fix build

Levi Zim requested to merge kxxt/prettier:fix-build into main

This package currently FTBFS due to incompatible nodejs used:

 Building packages        
index.mjs......................✘ [ERROR] module.exports is not a valid specifier [plugin evaluate]
                                                           
    node_modules/esbuild/lib/main.js:1276:21:
      1276 │         let result = await callback({
           ╵                      ^      
                                                           
    at file:///build/prettier/src/prettier/scripts/build/esbuild-plugins/evaluate.js:29:21
    at Array.map (<anonymous>)
    at file:///build/prettier/src/prettier/scripts/build/esbuild-plugins/evaluate.js:16:12
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async requestCallbacks.on-load (/build/prettier/src/prettier/node_modules/esbuild/lib/main.js:1276:22)
    at async handleRequest (/build/prettier/src/prettier/node_modules/esbuild/lib/main.js:647:11)

  This error came from the "onLoad" callback registered here:

    node_modules/esbuild/lib/main.js:1150:20:
      1150 │       let promise = setup({
           ╵                     ^

    at setup (file:///build/prettier/src/prettier/scripts/build/esbuild-plugins/evaluate.js:13:13)
    at handlePlugins (/build/prettier/src/prettier/node_modules/esbuild/lib/main.js:1150:21)
    at buildOrContextImpl (/build/prettier/src/prettier/node_modules/esbuild/lib/main.js:873:5)
    at Object.buildOrContext (/build/prettier/src/prettier/node_modules/esbuild/lib/main.js:699:5)
    at /build/prettier/src/prettier/node_modules/esbuild/lib/main.js:2028:15
    at new Promise (<anonymous>)
    at Object.build (/build/prettier/src/prettier/node_modules/esbuild/lib/main.js:2027:25)
    at Object.build (/build/prettier/src/prettier/node_modules/esbuild/lib/main.js:1878:51)
    at Object.runEsbuild [as build] (file:///build/prettier/src/prettier/scripts/build/build-javascript-module.js:284:41)

  The plugin "evaluate" was triggered by this import

    src/index.js:126:35:
      126 │ export { default as version } from "./main/version.evaluate.cjs";
          ╵                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   FAIL  
...

This PR fixes it by using a compatible nodejs version (20).

Merge request reports

Loading