Nuxt 3 build logs "unable to compile TypeScript"

App on Netlify
https://courageous-fox-6869a5.netlify.app

Code on Github
https://github.com/p3t3r67x0/nuxt-rc-netlify

Issue on Build
Nuxt 3 build fails as it seems to have any weird issues with the package ts-node. I have the feeling that it might be related to this nuxt-graphql-client package?

Anyone else has issues with deployment errors and typescript? I am thankful for any advise. More than two days I struggle to deploy a working Nuxt 3 app using Saleor GraphQL and Typescript.

Logs from Build

1:45:23 PM: Build ready to start
1:45:45 PM: build-image version: 9289b698a503f132b265bd089ab40ce1d6f9e65e (focal)
1:45:45 PM: build-image tag: v4.12.0
1:45:45 PM: buildbot version: c87074660cd9a4568c0ac759bc083987e94204b3
1:45:45 PM: Building without cache
1:45:45 PM: Starting to prepare the repo for build
1:45:45 PM: No cached dependencies found. Cloning fresh repo
1:45:45 PM: git clone https://github.com/p3t3r67x0/nuxt-rc-netlify
1:45:45 PM: Preparing Git Reference refs/heads/master
1:45:46 PM: Parsing package.json dependencies
1:45:46 PM: Different build command detected, going to use the one specified in the Netlify configuration file: 'npx pnpm install --shamefully-hoist --store=node_modules/.pnpm-store --frozen-lockfile && npm run build' versus '' in the Netlify UI
1:45:47 PM: Starting build script
1:45:47 PM: Installing dependencies
1:45:47 PM: Python version set to 2.7
1:45:47 PM: v16.17.1 is already installed.
1:45:47 PM: Now using node v16.17.1 (npm v8.15.0)
1:45:48 PM: Started restoring cached build plugins
1:45:48 PM: Finished restoring cached build plugins
1:45:48 PM: Attempting ruby version 2.7.2, read from environment
1:45:48 PM: Using ruby version 2.7.2
1:45:49 PM: Using PHP version 8.0
1:45:49 PM: No npm workspaces detected
1:45:49 PM: Started restoring cached node modules
1:45:49 PM: Finished restoring cached node modules
1:45:49 PM: Installing NPM modules using NPM version 8.15.0
1:45:49 PM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
1:45:49 PM: npm WARN config location in the cache, and they are managed by
1:45:49 PM: npm WARN config     [`cacache`](http://npm.im/cacache).
1:45:50 PM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
1:45:50 PM: npm WARN config location in the cache, and they are managed by
1:45:50 PM: npm WARN config     [`cacache`](http://npm.im/cacache).
1:45:50 PM: 8.15.0
1:45:50 PM: NPM modules installed
1:45:50 PM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
1:45:50 PM: npm WARN config location in the cache, and they are managed by
1:45:50 PM: npm WARN config     [`cacache`](http://npm.im/cacache).
1:45:50 PM: Started restoring cached go cache
1:45:50 PM: Finished restoring cached go cache
1:45:50 PM: Installing Go version 1.17 (requested 1.17)
1:45:54 PM: unset GOOS;
1:45:54 PM: unset GOARCH;
1:45:54 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.17.linux.amd64';
1:45:54 PM: export PATH="/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}";
1:45:54 PM: go version >&2;
1:45:54 PM: export GIMME_ENV="/opt/buildhome/.gimme/env/go1.17.linux.amd64.env"
1:45:54 PM: go version go1.17 linux/amd64
1:45:54 PM: Installing missing commands
1:45:54 PM: Verify run directory
1:45:55 PM: ​
1:45:55 PM: ────────────────────────────────────────────────────────────────
1:45:55 PM:   Netlify Build                                                 
1:45:55 PM: ────────────────────────────────────────────────────────────────
1:45:55 PM: ​
1:45:55 PM: ❯ Version
1:45:55 PM:   @netlify/build 27.20.1
1:45:55 PM: ​
1:45:55 PM: ❯ Flags
1:45:55 PM:   baseRelDir: true
1:45:55 PM:   buildId: 6342b4538975e30b905f3c62
1:45:55 PM:   deployId: 6342b4538975e30b905f3c64
1:45:55 PM: ​
1:45:55 PM: ❯ Current directory
1:45:55 PM:   /opt/build/repo
1:45:55 PM: ​
1:45:55 PM: ❯ Config file
1:45:55 PM:   /opt/build/repo/netlify.toml
1:45:55 PM: ​
1:45:55 PM: ❯ Context
1:45:55 PM:   production
1:45:55 PM: ​
1:45:55 PM: ────────────────────────────────────────────────────────────────
1:45:55 PM:   1. build.command from netlify.toml                            
1:45:55 PM: ────────────────────────────────────────────────────────────────
1:45:55 PM: ​
1:45:55 PM: $ npx pnpm install --shamefully-hoist --store=node_modules/.pnpm-store --frozen-lockfile && npm run build
1:45:55 PM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
1:45:55 PM: npm WARN config location in the cache, and they are managed by
1:45:55 PM: npm WARN config     [`cacache`](http://npm.im/cacache).
1:45:56 PM: npm WARN exec The following package was not found and will be installed: pnpm@7.13.2
1:45:57 PM: Lockfile is up to date, resolution step is skipped
1:45:57 PM: Progress: resolved 1, reused 0, downloaded 0, added 0
1:45:57 PM: Packages: +951
1:45:57 PM: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1:45:57 PM: Packages are hard linked from the content-addressable store to the virtual store.
1:45:57 PM:   Content-addressable store is at: /opt/build/repo/node_modules/.pnpm-store/v3
1:45:57 PM:   Virtual store is at:             node_modules/.pnpm
1:45:58 PM: Progress: resolved 951, reused 0, downloaded 93, added 88
1:45:59 PM: Progress: resolved 951, reused 0, downloaded 207, added 203
1:46:00 PM: Progress: resolved 951, reused 0, downloaded 354, added 354
1:46:01 PM: Progress: resolved 951, reused 0, downloaded 438, added 436
1:46:02 PM: Progress: resolved 951, reused 0, downloaded 616, added 611
1:46:03 PM: Progress: resolved 951, reused 0, downloaded 765, added 764
1:46:04 PM: Progress: resolved 951, reused 0, downloaded 947, added 946
1:46:04 PM: .../node_modules/vue-demi postinstall$ node ./scripts/postinstall.js
1:46:04 PM: .../node_modules/vue-demi postinstall: Done
1:46:04 PM: .../esbuild@0.15.10/node_modules/esbuild postinstall$ node install.js
1:46:04 PM: .../esbuild@0.15.10/node_modules/esbuild postinstall: Done
1:46:05 PM: Progress: resolved 951, reused 0, downloaded 951, added 951, done
1:46:05 PM: dependencies:
1:46:05 PM: + @nuxtjs/tailwindcss 5.3.5
1:46:05 PM: + @pinia/nuxt 0.4.3
1:46:05 PM: + @types/node 18.8.3
1:46:05 PM: + graphql 16.6.0
1:46:05 PM: + graphql-tag 2.12.6
1:46:05 PM: + nuxt-graphql-client 0.1.19
1:46:05 PM: + ts-node 10.9.1
1:46:05 PM: + typescript 4.8.4
1:46:05 PM: + vue 3.2.40
1:46:05 PM: + webpack 5.74.0
1:46:05 PM: devDependencies:
1:46:05 PM: + nuxt 3.0.0-rc.11
1:46:05 PM: > @ postinstall /opt/build/repo
1:46:05 PM: > nuxt prepare
1:46:05 PM: [log] Nuxi 3.0.0-rc.11
1:46:05 PM: [info] [nuxt:tailwindcss] Using default Tailwind CSS file from runtime/tailwind.css
1:46:06 PM: [error] β¨― Unable to compile TypeScript:
1:46:06 PM: error TS5083: Cannot read file '/opt/build/repo/.nuxt/tsconfig.json'.
1:46:06 PM:   error TS5083: Cannot read file '.nuxt/tsconfig.json'.
1:46:06 PM:   at createTSError (node_modules/.pnpm/ts-node@10.9.1_xtdkmayvpbwqd3kc4kczaw2zvm/node_modules/ts-node/src/index.ts:859:12)
1:46:06 PM:   at reportTSError (node_modules/.pnpm/ts-node@10.9.1_xtdkmayvpbwqd3kc4kczaw2zvm/node_modules/ts-node/src/index.ts:863:19)
1:46:06 PM:   at createFromPreloadedConfig (node_modules/.pnpm/ts-node@10.9.1_xtdkmayvpbwqd3kc4kczaw2zvm/node_modules/ts-node/src/index.ts:874:36)
1:46:06 PM:   at create (node_modules/.pnpm/ts-node@10.9.1_xtdkmayvpbwqd3kc4kczaw2zvm/node_modules/ts-node/src/index.ts:624:10)
1:46:06 PM:   at register (node_modules/.pnpm/ts-node@10.9.1_xtdkmayvpbwqd3kc4kczaw2zvm/node_modules/ts-node/src/index.ts:591:15)
1:46:06 PM:   at TypeScriptLoader (node_modules/.pnpm/cosmiconfig-typescript-loader@4.1.1_mwz2f5nk5qxm3a6zkoxfkps5ya/node_modules/cosmiconfig-typescript-loader/dist/cjs/index.js:52:54)
1:46:06 PM:   at node_modules/.pnpm/@graphql-codegen+cli@2.13.5_bcskau5n4us7t7edj5bgrx4upa/node_modules/@graphql-codegen/cli/esm/config.js:16:18
1:46:06 PM:   at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
1:46:06 PM:   at async Promise.all (index 0)
1:46:06 PM:   at async ESMLoader.import (node:internal/modules/esm/loader:533:24)
1:46:06 PM:   at async normalizeModule (node_modules/.pnpm/@nuxt+kit@3.0.0-rc.11/node_modules/@nuxt/kit/dist/index.mjs:476:26)
1:46:06 PM:   at async installModule (node_modules/.pnpm/@nuxt+kit@3.0.0-rc.11/node_modules/@nuxt/kit/dist/index.mjs:455:41)
1:46:06 PM:   at async initNuxt (node_modules/.pnpm/nuxt@3.0.0-rc.11_typescript@4.8.4/node_modules/nuxt/dist/index.mjs:1606:7)
1:46:06 PM:   at async loadNuxt (node_modules/.pnpm/nuxt@3.0.0-rc.11_typescript@4.8.4/node_modules/nuxt/dist/index.mjs:1635:5)
1:46:06 PM:   at async loadNuxt (node_modules/.pnpm/@nuxt+kit@3.0.0-rc.11/node_modules/@nuxt/kit/dist/index.mjs:732:19)
1:46:06 PM:   at async Object.invoke (node_modules/.pnpm/nuxi@3.0.0-rc.11/node_modules/nuxi/dist/chunks/prepare.mjs:30:18)
1:46:06 PM:   at async _main (node_modules/.pnpm/nuxi@3.0.0-rc.11/node_modules/nuxi/dist/cli.mjs:50:20)
1:46:06 PM:  ELIFECYCLE  Command failed with exit code 1. (https://ntl.fyi/exit-code-1)
1:46:06 PM: ​
1:46:06 PM: ────────────────────────────────────────────────────────────────
1:46:06 PM:   "build.command" failed                                        
1:46:06 PM: ────────────────────────────────────────────────────────────────
1:46:06 PM: ​
1:46:06 PM:   Error message
1:46:06 PM:   Command failed with exit code 1: npx pnpm install --shamefully-hoist --store=node_modules/.pnpm-store --frozen-lockfile && npm run build (https://ntl.fyi/exit-code-1)
1:46:06 PM: ​
1:46:06 PM:   Error location
1:46:06 PM:   In build.command from netlify.toml:
1:46:06 PM:   npx pnpm install --shamefully-hoist --store=node_modules/.pnpm-store --frozen-lockfile && npm run build
1:46:06 PM: ​
1:46:06 PM:   Resolved config
1:46:06 PM:   build:
1:46:06 PM:     command: npx pnpm install --shamefully-hoist --store=node_modules/.pnpm-store --frozen-lockfile && npm run build
1:46:06 PM:     commandOrigin: config
1:46:06 PM:     environment:
1:46:06 PM:       - NPM_FLAGS
1:46:06 PM:     publish: /opt/build/repo
1:46:06 PM:     publishOrigin: default
1:46:07 PM: Caching artifacts
1:46:07 PM: Started saving node modules
1:46:07 PM: Finished saving node modules
1:46:07 PM: Started saving build plugins
1:46:07 PM: Finished saving build plugins
1:46:07 PM: Started saving pip cache
1:46:07 PM: Finished saving pip cache
1:46:07 PM: Started saving emacs cask dependencies
1:46:07 PM: Finished saving emacs cask dependencies
1:46:07 PM: Started saving maven dependencies
1:46:07 PM: Finished saving maven dependencies
1:46:07 PM: Started saving boot dependencies
1:46:07 PM: Finished saving boot dependencies
1:46:07 PM: Started saving rust rustup cache
1:46:07 PM: Finished saving rust rustup cache
1:46:07 PM: Started saving go dependencies
1:46:07 PM: Finished saving go dependencies
1:46:08 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
1:46:08 PM: Creating deploy upload records
1:46:08 PM: Failing build: Failed to build site
1:46:08 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
1:46:08 PM: Finished processing build request in 23.223736173s

I have been lost now, would love any help. thanks in advance

Not sure if this discussion might be useful… but I asked it here as well to get any answer from anyone… error TS5083: Cannot read file 'project/.nuxt/tsconfig.json'. Β· Issue #1912 Β· nuxt/framework Β· GitHub

I’d be shooting in the dark, but does --skipLibCheck flag for your TypeScript compilation work?

1 Like

thanks for your reply.

Unfortunately this does not solve the compile errors during build time. I still get the following error on deploy…

error TS5083: Cannot read file '.nuxt/tsconfig.json'

this is how my tsconfig.json looks like

{
  "extends": "./.nuxt/tsconfig.json",
  "compilerOptions": {
    "skipLibCheck": true,
    "listFiles": true
  }
}

Log from Build

6:42:36 PM: build-image version: 9289b698a503f132b265bd089ab40ce1d6f9e65e (focal)
6:42:36 PM: build-image tag: v4.12.0
6:42:36 PM: buildbot version: c87074660cd9a4568c0ac759bc083987e94204b3
6:42:36 PM: Building without cache
6:42:36 PM: Starting to prepare the repo for build
6:42:36 PM: No cached dependencies found. Cloning fresh repo
6:42:36 PM: git clone https://github.com/p3t3r67x0/nuxt-rc-netlify
6:42:36 PM: Preparing Git Reference refs/heads/master
6:42:36 PM: Parsing package.json dependencies
6:42:37 PM: Different build command detected, going to use the one specified in the Netlify configuration file: 'npx pnpm install --shamefully-hoist --store=node_modules/.pnpm-store --frozen-lockfile && npm run build' versus '' in the Netlify UI
6:42:37 PM: Starting build script
6:42:37 PM: Installing dependencies
6:42:37 PM: Python version set to 2.7
6:42:38 PM: v16.17.1 is already installed.
6:42:38 PM: Now using node v16.17.1 (npm v8.15.0)
6:42:38 PM: Started restoring cached build plugins
6:42:38 PM: Finished restoring cached build plugins
6:42:38 PM: Attempting ruby version 2.7.2, read from environment
6:42:39 PM: Using ruby version 2.7.2
6:42:39 PM: Using PHP version 8.0
6:42:39 PM: No npm workspaces detected
6:42:39 PM: Started restoring cached node modules
6:42:39 PM: Finished restoring cached node modules
6:42:40 PM: Installing NPM modules using NPM version 8.15.0
6:42:40 PM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
6:42:40 PM: npm WARN config location in the cache, and they are managed by
6:42:40 PM: npm WARN config     [`cacache`](http://npm.im/cacache).
6:42:40 PM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
6:42:40 PM: npm WARN config location in the cache, and they are managed by
6:42:40 PM: npm WARN config     [`cacache`](http://npm.im/cacache).
6:42:40 PM: 8.15.0
6:42:40 PM: NPM modules installed
6:42:40 PM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
6:42:40 PM: npm WARN config location in the cache, and they are managed by
6:42:40 PM: npm WARN config     [`cacache`](http://npm.im/cacache).
6:42:40 PM: Started restoring cached go cache
6:42:40 PM: Finished restoring cached go cache
6:42:40 PM: Installing Go version 1.17 (requested 1.17)
6:42:48 PM: unset GOOS;
6:42:48 PM: unset GOARCH;
6:42:48 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.17.linux.amd64';
6:42:48 PM: export PATH="/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}";
6:42:48 PM: go version >&2;
6:42:48 PM: export GIMME_ENV="/opt/buildhome/.gimme/env/go1.17.linux.amd64.env"
6:42:48 PM: go version go1.17 linux/amd64
6:42:48 PM: Installing missing commands
6:42:48 PM: Verify run directory
6:42:49 PM: ​
6:42:49 PM: ────────────────────────────────────────────────────────────────
6:42:49 PM:   Netlify Build                                                 
6:42:49 PM: ────────────────────────────────────────────────────────────────
6:42:49 PM: ​
6:42:49 PM: ❯ Version
6:42:49 PM:   @netlify/build 27.20.1
6:42:49 PM: ​
6:42:49 PM: ❯ Flags
6:42:49 PM:   baseRelDir: true
6:42:49 PM:   buildId: 6342f9faccdf94368f341af7
6:42:49 PM:   deployId: 6342f9faccdf94368f341af9
6:42:49 PM: ​
6:42:49 PM: ❯ Current directory
6:42:49 PM:   /opt/build/repo
6:42:49 PM: ​
6:42:49 PM: ❯ Config file
6:42:49 PM:   /opt/build/repo/netlify.toml
6:42:49 PM: ​
6:42:49 PM: ❯ Context
6:42:49 PM:   production
6:42:49 PM: ​
6:42:49 PM: ────────────────────────────────────────────────────────────────
6:42:49 PM:   1. build.command from netlify.toml                            
6:42:49 PM: ────────────────────────────────────────────────────────────────
6:42:49 PM: ​
6:42:49 PM: $ npx pnpm install --shamefully-hoist --store=node_modules/.pnpm-store --frozen-lockfile && npm run build
6:42:49 PM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
6:42:49 PM: npm WARN config location in the cache, and they are managed by
6:42:49 PM: npm WARN config     [`cacache`](http://npm.im/cacache).
6:42:49 PM: npm WARN exec The following package was not found and will be installed: pnpm@7.13.3
6:42:50 PM: Lockfile is up to date, resolution step is skipped
6:42:50 PM: Progress: resolved 1, reused 0, downloaded 0, added 0
6:42:50 PM: Packages: +951
6:42:50 PM: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6:42:50 PM: Packages are hard linked from the content-addressable store to the virtual store.
6:42:50 PM:   Content-addressable store is at: /opt/build/repo/node_modules/.pnpm-store/v3
6:42:50 PM:   Virtual store is at:             node_modules/.pnpm
6:42:51 PM: Progress: resolved 951, reused 0, downloaded 64, added 57
6:42:52 PM: Progress: resolved 951, reused 0, downloaded 138, added 134
6:42:53 PM: Progress: resolved 951, reused 0, downloaded 200, added 194
6:42:54 PM: Progress: resolved 951, reused 0, downloaded 262, added 259
6:42:55 PM: Progress: resolved 951, reused 0, downloaded 353, added 349
6:42:56 PM: Progress: resolved 951, reused 0, downloaded 437, added 437
6:42:57 PM: Progress: resolved 951, reused 0, downloaded 549, added 546
6:42:58 PM: Progress: resolved 951, reused 0, downloaded 653, added 647
6:42:59 PM: Progress: resolved 951, reused 0, downloaded 758, added 755
6:43:00 PM: Progress: resolved 951, reused 0, downloaded 884, added 883
6:43:01 PM: .../node_modules/vue-demi postinstall$ node ./scripts/postinstall.js
6:43:01 PM: .../node_modules/vue-demi postinstall: Done
6:43:01 PM: Progress: resolved 951, reused 0, downloaded 951, added 951, done
6:43:01 PM: .../esbuild@0.15.10/node_modules/esbuild postinstall$ node install.js
6:43:01 PM: .../esbuild@0.15.10/node_modules/esbuild postinstall: Done
6:43:01 PM: dependencies:
6:43:01 PM: + @nuxtjs/tailwindcss 5.3.5
6:43:01 PM: + @pinia/nuxt 0.4.3
6:43:01 PM: + @types/node 18.8.3
6:43:01 PM: + graphql 16.6.0
6:43:01 PM: + graphql-tag 2.12.6
6:43:01 PM: + nuxt-graphql-client 0.1.19
6:43:01 PM: + ts-node 10.9.1
6:43:01 PM: + typescript 4.8.4
6:43:01 PM: + vue 3.2.40
6:43:01 PM: + webpack 5.74.0
6:43:01 PM: devDependencies:
6:43:01 PM: + nuxt 3.0.0-rc.11
6:43:01 PM: > @ postinstall /opt/build/repo
6:43:01 PM: > nuxt prepare
6:43:01 PM: [log] Nuxi 3.0.0-rc.11
6:43:02 PM: [info] [nuxt:tailwindcss] Using default Tailwind CSS file from runtime/tailwind.css
6:43:03 PM: [error] β¨― Unable to compile TypeScript:
6:43:03 PM: error TS5083: Cannot read file '/opt/build/repo/.nuxt/tsconfig.json'.
6:43:03 PM:   error TS5083: Cannot read file '.nuxt/tsconfig.json'.
6:43:03 PM:   at createTSError (node_modules/.pnpm/ts-node@10.9.1_xtdkmayvpbwqd3kc4kczaw2zvm/node_modules/ts-node/src/index.ts:859:12)
6:43:03 PM:   at reportTSError (node_modules/.pnpm/ts-node@10.9.1_xtdkmayvpbwqd3kc4kczaw2zvm/node_modules/ts-node/src/index.ts:863:19)
6:43:03 PM:   at createFromPreloadedConfig (node_modules/.pnpm/ts-node@10.9.1_xtdkmayvpbwqd3kc4kczaw2zvm/node_modules/ts-node/src/index.ts:874:36)
6:43:03 PM:   at create (node_modules/.pnpm/ts-node@10.9.1_xtdkmayvpbwqd3kc4kczaw2zvm/node_modules/ts-node/src/index.ts:624:10)
6:43:03 PM:   at register (node_modules/.pnpm/ts-node@10.9.1_xtdkmayvpbwqd3kc4kczaw2zvm/node_modules/ts-node/src/index.ts:591:15)
6:43:03 PM:   at TypeScriptLoader (node_modules/.pnpm/cosmiconfig-typescript-loader@4.1.1_mwz2f5nk5qxm3a6zkoxfkps5ya/node_modules/cosmiconfig-typescript-loader/dist/cjs/index.js:52:54)
6:43:03 PM:   at node_modules/.pnpm/@graphql-codegen+cli@2.13.5_bcskau5n4us7t7edj5bgrx4upa/node_modules/@graphql-codegen/cli/esm/config.js:16:18
6:43:03 PM:   at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
6:43:03 PM:   at async Promise.all (index 0)
6:43:03 PM:   at async ESMLoader.import (node:internal/modules/esm/loader:533:24)
6:43:03 PM:   at async normalizeModule (node_modules/.pnpm/@nuxt+kit@3.0.0-rc.11/node_modules/@nuxt/kit/dist/index.mjs:476:26)
6:43:03 PM:   at async installModule (node_modules/.pnpm/@nuxt+kit@3.0.0-rc.11/node_modules/@nuxt/kit/dist/index.mjs:455:41)
6:43:03 PM:   at async initNuxt (node_modules/.pnpm/nuxt@3.0.0-rc.11_typescript@4.8.4/node_modules/nuxt/dist/index.mjs:1606:7)
6:43:03 PM:   at async loadNuxt (node_modules/.pnpm/nuxt@3.0.0-rc.11_typescript@4.8.4/node_modules/nuxt/dist/index.mjs:1635:5)
6:43:03 PM:   at async loadNuxt (node_modules/.pnpm/@nuxt+kit@3.0.0-rc.11/node_modules/@nuxt/kit/dist/index.mjs:732:19)
6:43:03 PM:   at async Object.invoke (node_modules/.pnpm/nuxi@3.0.0-rc.11/node_modules/nuxi/dist/chunks/prepare.mjs:30:18)
6:43:03 PM:   at async _main (node_modules/.pnpm/nuxi@3.0.0-rc.11/node_modules/nuxi/dist/cli.mjs:50:20)
6:43:03 PM:  ELIFECYCLE  Command failed with exit code 1. (https://ntl.fyi/exit-code-1)
6:43:03 PM: ​
6:43:03 PM: ────────────────────────────────────────────────────────────────
6:43:03 PM:   "build.command" failed                                        
6:43:03 PM: ────────────────────────────────────────────────────────────────
6:43:03 PM: ​
6:43:03 PM:   Error message
6:43:03 PM:   Command failed with exit code 1: npx pnpm install --shamefully-hoist --store=node_modules/.pnpm-store --frozen-lockfile && npm run build (https://ntl.fyi/exit-code-1)
6:43:03 PM: ​
6:43:03 PM:   Error location
6:43:03 PM:   In build.command from netlify.toml:
6:43:03 PM:   npx pnpm install --shamefully-hoist --store=node_modules/.pnpm-store --frozen-lockfile && npm run build
6:43:04 PM: Creating deploy upload records
6:43:03 PM: ​
6:43:03 PM:   Resolved config
6:43:03 PM:   build:
6:43:03 PM:     command: npx pnpm install --shamefully-hoist --store=node_modules/.pnpm-store --frozen-lockfile && npm run build
6:43:04 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
6:43:03 PM:     commandOrigin: config
6:43:03 PM:     environment:
6:43:03 PM:       - NPM_FLAGS
6:43:03 PM:     publish: /opt/build/repo
6:43:03 PM:     publishOrigin: default
6:43:03 PM: Caching artifacts
6:43:03 PM: Started saving node modules
6:43:03 PM: Finished saving node modules
6:43:03 PM: Started saving build plugins
6:43:03 PM: Finished saving build plugins
6:43:03 PM: Started saving pip cache
6:43:03 PM: Finished saving pip cache
6:43:03 PM: Started saving emacs cask dependencies
6:43:03 PM: Finished saving emacs cask dependencies
6:43:03 PM: Started saving maven dependencies
6:43:03 PM: Finished saving maven dependencies
6:43:03 PM: Started saving boot dependencies
6:43:03 PM: Finished saving boot dependencies
6:43:03 PM: Started saving rust rustup cache
6:43:03 PM: Finished saving rust rustup cache
6:43:03 PM: Started saving go dependencies
6:43:03 PM: Finished saving go dependencies
6:43:04 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
6:43:04 PM: Failing build: Failed to build site
6:43:04 PM: Finished processing build request in 28.668094296s

any idea?

Can we approach this the brute force way? How about you create a tsconfig.json file in that directory which can probably as well be blank or {}?

1 Like

Thanks for your reply as far as I understand you suggest to create a tsconfig.json file on the root?

There is already one…

I have been googling for hours… no idea what is happening behind the scenes.

I was not giving up to deploy this repo. I was running out of ideas and just tested to delete the tsconfig.json which suddenly the deploy build run through… so it is not a clean soloution but for now it does the job…

last commit

Actually it should be investigated why this does not run on Netlify. who could be so kind and connect me with dev team?

Hi @p3t3r67x0

This error occurs locally tooβ€”I just tried.

The reason for this is the .nuxt directory only exists after buildβ€”this is the directory Nuxt builds to. So the tcsonfig.json is trying to extend a file that does not yet exist (it may exist locally on your system as you alread have a .nuxt directory from previous builds.)

1 Like

Hi @coelmay

That’s probably right. As far as I can tell when running npm run build this process should trigger the command nuxt prepare which should generate the .nuxt folder. As far as I can tell.

Actually I guess the extend command inside the .tsconfig.json is not working as ts-node is located under /node_modules folder and not the same root.

Probably this GitHub issue is related to mine?

Anyone from ts-node module here?

In the package.json of the repository, there is a postinstall script which runs nuxt prepare. So after running npm install this script runs. However, with the tsconfig.json present with the extends keys, this fails because it is expecting to see .nuxt/tsconfig.json.

I see you commented on error TS5083: Cannot read file 'project/.nuxt/tsconfig.json'. Β· Issue #1912 Β· nuxt/framework Β· GitHub (and were politely asked to create a new issue; have you?)

I use Typescript little, and don’t use Nuxt (esp. v3) much any more as it doesn’t suit my needs. I am sure there is a simple explanation/solution. As I can see this is an issue when running locally and not just on Netlify, I suggest the best place to get assistance is on the Nuxt framework repository by creating an new issue or a new discussion.

1 Like

hi @coelmay, thanks for your hint. I opened an issue on GitHub. I am pretty sure this might be an simple thing which I did wrong in use of ts-node.