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

New Vite requirements gives warning when building "for the first time" #5390

Closed
uranderu opened this issue Jul 6, 2022 · 30 comments
Closed

Comments

@uranderu
Copy link

uranderu commented Jul 6, 2022

Describe the bug

Hi,

If I'm not mistaken since the new build changes introduced in PR #5332 I'm getting this error when building:

[WARNING] Cannot find base config file "./.svelte-kit/tsconfig.json" [tsconfig.json]

    tsconfig.json:2:12:
      2 │   "extends": "./.svelte-kit/tsconfig.json",
        ╵              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Now this is quite logical because the .svelte-kit folder is in my (and this repos) .gitignore. The folder (and the tsconfig.json file) does get generated after running once, but that isn't a solution since you'd generally build in a CI/CD pipeline.

I don't know if this is a problem or not, but thought it would be better to report it in any case.

Thanks for the amazing work you all have done! :)

Reproduction

My project where this is happening: link
Logs of a CI/CD step where you can see this: link

If you want to recreate it using my repo here are the steps:

  • Clone my repo
  • run npm install
  • run npm run build

Logs

Relevant part:

Step 7/9 : RUN npm run build
 ---> Running in bef9c63132b9
> [email protected] build
> vite build
▲ [WARNING] Cannot find base config file "./.svelte-kit/tsconfig.json" [tsconfig.json]
    tsconfig.json:2:12:
      2 │   "extends": "./.svelte-kit/tsconfig.json",
        ╵              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

System Info

  npmPackages:
    @sveltejs/adapter-auto: next => 1.0.0-next.53 
    @sveltejs/adapter-static: ^1.0.0-next.34 => 1.0.0-next.34 
    @sveltejs/kit: next => 1.0.0-next.360 
    svelte: ^3.44.0 => 3.48.0 
    vite: ^2.9.13 => 2.9.13

Severity

annoyance

Additional Information

My package.json file:

{
	"name": "personal-website",
	"version": "0.0.1",
	"scripts": {
		"dev": "vite dev",
		"build": "vite build",
		"package": "svelte-kit package",
		"preview": "vite preview",
		"prepare": "svelte-kit sync",
		"test": "playwright test",
		"check": "svelte-check --tsconfig ./tsconfig.json",
		"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
		"lint": "prettier --check --plugin-search-dir=. . && eslint .",
		"format": "prettier --write --plugin-search-dir=. ."
	},
	"devDependencies": {
		"@playwright/test": "^1.22.2",
		"@sveltejs/adapter-auto": "next",
		"@sveltejs/adapter-static": "^1.0.0-next.34",
		"@sveltejs/kit": "next",
		"@typescript-eslint/eslint-plugin": "^5.27.0",
		"@typescript-eslint/parser": "^5.27.0",
		"bootstrap": "^5.1.3",
		"eslint": "^8.16.0",
		"eslint-config-prettier": "^8.3.0",
		"eslint-plugin-svelte3": "^4.0.0",
		"prettier": "^2.6.2",
		"prettier-plugin-svelte": "^2.7.0",
		"sass": "^1.49.11",
		"svelte": "^3.44.0",
		"svelte-check": "^2.7.1",
		"svelte-preprocess": "^4.10.5",
		"tslib": "^2.3.1",
		"typescript": "^4.7.2",
		"vite": "^2.9.13"
	},
	"type": "module"
}
@phenomen

This comment was marked as off-topic.

@benmccann
Copy link
Member

Make sure you have the following line in your package.json. It will create the file when you run npm install.

		"prepare": "svelte-kit sync",

@uranderu
Copy link
Author

uranderu commented Jul 6, 2022

Make sure you have the following line in your package.json. It will create the file when you run npm install.

		"prepare": "svelte-kit sync",

It's there. I've updated this issue with my entire package.json file just to be sure.

@benmccann
Copy link
Member

benmccann commented Jul 6, 2022

I just ran the following commands and didn't see any issue:

git clone https://gitlab.com/uranderu/personal-website.git
cd personal-website/
npm install
npm run build

@Rich-Harris
Copy link
Member

@phenomen this wouldn't fail the build, you're experiencing a different error in addition to this (harmless) warning

@ghost

This comment was marked as off-topic.

@benmccann

This comment was marked as off-topic.

@uranderu
Copy link
Author

uranderu commented Jul 7, 2022

I just ran the following commands and didn't see any issue:

git clone https://gitlab.com/uranderu/personal-website.git
cd personal-website/
npm install
npm run build

Hi, I've done some testing and I'm getting the same results as you. Indeed after running npm install I'm getting the .svelte-kit folder and then the error is gone when building. In my initial test on my PC I removed all the generated folders/files including the .svelte-kit folder which explains the error.

However, I'm still getting these issues on Gitlab CI/CD but I think that is an issue with them since I'm not getting these errors when running the dockerfile locally on my machine. And since @Rich-Harris said it is a harmless warning (and I'm not seeing any problems) I'm fine with it. Thank you for your help!

Edit: I've found out what caused the issue on Gitlab CI/CD. I didn't copy the "svelte.config.js" file before I ran "npm install" which ran "svelte-kit sync". I'm not going to clarify my weird (and now changed) Dockerfile but I wanted to update this comment since I accused Gitlab CI/CD.

@uranderu uranderu closed this as completed Jul 7, 2022
@ogrotten
Copy link

ogrotten commented Aug 4, 2022

And since @Rich-Harris said it is a harmless warning

Can you link to this please?

@uranderu
Copy link
Author

uranderu commented Aug 4, 2022

@phenomen this wouldn't fail the build, you're experiencing a different error in addition to this (harmless) warning

There you go, it's in one of the comments marked off-topic above.

@ogrotten
Copy link

ogrotten commented Aug 4, 2022

@phenomen this wouldn't fail the build, you're experiencing a different error in addition to this (harmless) warning

There you go, it's in one of the comments marked off-topic above.

Wow ok. Thanks I completely missed that... which would be the effect of hiding things in issue threads. It seems anti productive. Just because it's off topic doesn't mean it's irrelevant.

@ollyde
Copy link

ollyde commented Feb 24, 2023

Trying to migrate a project from 5 months ago ...

Created a new project
npm create vite@latest

Select SvelteKit and TypeScript

Try to run the project

[WARNING] Cannot find base config file "./.svelte-kit/tsconfig.json" [tsconfig.json]

    tsconfig.json:2:12:
      2 │   "extends": "./.svelte-kit/tsconfig.json",

Getting a little sick of the constant breaking changes on SvelteKit.

@uranderu
Copy link
Author

uranderu commented Feb 24, 2023

Trying to migrate a project from 5 months ago ...

Created a new project npm create vite@latest

Select SvelteKit and TypeScript

Try to run the project

[WARNING] Cannot find base config file "./.svelte-kit/tsconfig.json" [tsconfig.json]

    tsconfig.json:2:12:
      2 │   "extends": "./.svelte-kit/tsconfig.json",

Normally this gets generated automatically on the first startup. Maybe try the official way to create a project? npm create svelte@latest my-app

Getting a little sick of the constant breaking changes on SvelteKit.

Five months ago SvelteKit was still in beta, so breaking changes were a possibility. Nevertheless, they warned people that breaking changes will occur. If I'm not mistaken it was right at the top of the README.

@FoodlyEric
Copy link

when I am on @svektejs/kit 1.13 or 1.14 I get build fail on netlify.
Going back to @sveltejs/kit 1.5.0 fixes the issue.

3:16:40 PM: build-image version: 099264affa13d33ffbaea4ccf963ddbead423c30 (focal)
3:16:40 PM: buildbot version: 099264affa13d33ffbaea4ccf963ddbead423c30
3:16:40 PM: Fetching cached dependencies
3:16:40 PM: Starting to download cache of 802.2MB
3:16:42 PM: Finished downloading cache in 2.101s
3:16:42 PM: Starting to extract cache
3:16:47 PM: Finished extracting cache in 4.831s
3:16:47 PM: Finished fetching cache in 7.017s
3:16:47 PM: Starting to prepare the repo for build
3:16:48 PM: Preparing Git Reference refs/heads/storybook
3:16:48 PM: Parsing package.json dependencies
3:16:50 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: 'storybook-static' versus '' in the Netlify UI
3:16:50 PM: Different build command detected, going to use the one specified in the Netlify configuration file: 'yarn build-storybook' versus '' in the Netlify UI
3:16:50 PM: Starting build script
3:16:50 PM: Installing dependencies
3:16:50 PM: Python version set to 2.7
3:16:50 PM: Started restoring cached Node.js version
3:16:51 PM: Finished restoring cached Node.js version
3:16:51 PM: Attempting Node.js version '18' from .nvmrc
3:16:51 PM: v18.15.0 is already installed.
3:16:52 PM: Now using node v18.15.0 (npm v9.5.0)
3:16:52 PM: Enabling Node.js Corepack
3:16:52 PM: Started restoring cached build plugins
3:16:52 PM: Finished restoring cached build plugins
3:16:52 PM: Attempting Ruby version 2.7.2, read from environment
3:16:54 PM: Using Ruby version 2.7.2
3:16:54 PM: Using PHP version 8.0
3:16:54 PM: Started restoring cached corepack dependencies
3:16:54 PM: Finished restoring cached corepack dependencies
3:16:54 PM: Started restoring cached yarn cache
3:16:59 PM: Finished restoring cached yarn cache
3:16:59 PM: No yarn workspaces detected
3:16:59 PM: Started restoring cached node modules
3:16:59 PM: Finished restoring cached node modules
3:17:00 PM: Installing npm packages using Yarn version 1.22.19
3:17:00 PM: yarn install v1.22.19
3:17:00 PM: [1/4] Resolving packages...
3:17:00 PM: [2/4] Fetching packages...
3:17:01 PM: [3/4] Linking dependencies...
3:17:01 PM: warning " > @storybook/[email protected]" has unmet peer dependency "@storybook/theming@^7.0.0-beta".
3:17:03 PM: [4/4] Building fresh packages...
3:17:03 PM: Done in 2.95s.
3:17:03 PM: npm packages installed using Yarn
3:17:03 PM: Started restoring cached go cache
3:17:03 PM: Finished restoring cached go cache
3:17:03 PM: go version go1.19.7 linux/amd64
3:17:04 PM: Detected 1 framework(s)
3:17:04 PM: "svelte-kit" at version "1.14.0"
3:17:04 PM: Section completed: initializing
3:17:05 PM: ​
3:17:05 PM:   Netlify Build                                                 
3:17:05 PM: ────────────────────────────────────────────────────────────────
3:17:05 PM: ​
3:17:05 PM: ❯ Version
3:17:05 PM:   @netlify/build 29.7.1
3:17:05 PM: ​
3:17:05 PM: ❯ Flags
3:17:05 PM:   baseRelDir: true
3:17:05 PM:   buildId: 642134bf4b4365000815d634
3:17:05 PM:   deployId: 642134bf4b4365000815d636
3:17:05 PM: ​
3:17:05 PM: ❯ Current directory
3:17:05 PM:   /opt/build/repo
3:17:05 PM: ​
3:17:05 PM: ❯ Config file
3:17:05 PM:   /opt/build/repo/netlify.toml
3:17:05 PM: ​
3:17:05 PM: ❯ Context
3:17:05 PM:   production
3:17:05 PM: ​
3:17:05 PM:   1. build.command from netlify.toml                            
3:17:05 PM: ────────────────────────────────────────────────────────────────
3:17:05 PM: ​
3:17:05 PM: $ yarn build-storybook
3:17:05 PM: yarn run v1.22.19
3:17:05 PM: $ storybook build --disable-telemetry
3:17:06 PM: @storybook/cli v7.0.0-rc.8
3:17:06 PM: 
3:17:06 PM: info => Cleaning outputDir: /storybook-static
3:17:06 PM: info => Loading presets
3:17:07 PM: info => Building manager..
3:17:08 PM: info => Manager built (164 ms)
3:17:08 PM: info => Copying static files: /opt/build/repo/node_modules/@storybook/manager/static at /opt/build/repo/storybook-static/sb-common-assets
3:17:08 PM: ▲ [WARNING] Cannot find base config file "./.svelte-kit/tsconfig.json" [tsconfig.json]
3:17:08 PM:     tsconfig.json:2:13:
3:17:08 PM:       2 │   "extends": "./.svelte-kit/tsconfig.json",
3:17:08 PM:         ╵              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3:17:10 PM: WARN 🚨 Unable to index files:
3:17:10 PM: WARN - ./src/stories/Button.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: WARN - ./src/stories/Input.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: WARN - ./src/stories/Keypad.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: WARN - ./src/stories/Radio.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: WARN - ./src/stories/Switch.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: WARN - ./src/stories/components/Icons.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: WARN 🚨 Unable to index files:
3:17:10 PM: WARN - ./src/stories/Button.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: WARN - ./src/stories/Input.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: WARN - ./src/stories/Keypad.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: WARN - ./src/stories/Radio.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: WARN - ./src/stories/Switch.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: WARN - ./src/stories/components/Icons.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: ERR! Error: Unable to index files:
3:17:10 PM: ERR! - ./src/stories/Button.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: ERR! - ./src/stories/Input.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: ERR! - ./src/stories/Keypad.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: ERR! - ./src/stories/Radio.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: ERR! - ./src/stories/Switch.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: ERR! - ./src/stories/components/Icons.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: ERR!     at StoryIndexGenerator.getIndex (/opt/build/repo/node_modules/@storybook/core-server/dist/index.js:17:3457)
3:17:10 PM: ERR!     at async extractStoriesJson (/opt/build/repo/node_modules/@storybook/core-server/dist/index.js:10:4403)
3:17:10 PM: ERR!     at async Promise.all (index 3)
3:17:10 PM: ERR!     at async buildStaticStandalone (/opt/build/repo/node_modules/@storybook/core-server/dist/index.js:23:1840)
3:17:10 PM: ERR!     at async withTelemetry (/opt/build/repo/node_modules/@storybook/core-server/dist/index.js:27:3469)
3:17:10 PM: ERR!     at async build (/opt/build/repo/node_modules/@storybook/cli/dist/generate.js:439:1056)
3:17:10 PM: ERR!     at async Command.<anonymous> (/opt/build/repo/node_modules/@storybook/cli/dist/generate.js:442:125)
3:17:10 PM: ERR!  MultipleIndexingError: Unable to index files:
3:17:10 PM: ERR! - ./src/stories/Button.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: ERR! - ./src/stories/Input.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: ERR! - ./src/stories/Keypad.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: ERR! - ./src/stories/Radio.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: ERR! - ./src/stories/Switch.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: ERR! - ./src/stories/components/Icons.stories.svelte: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: ERR!     at StoryIndexGenerator.getIndex (/opt/build/repo/node_modules/@storybook/core-server/dist/index.js:17:3457)
3:17:10 PM: ERR!     at async extractStoriesJson (/opt/build/repo/node_modules/@storybook/core-server/dist/index.js:10:4403)
3:17:10 PM: ERR!     at async Promise.all (index 3)
3:17:10 PM: ERR!     at async buildStaticStandalone (/opt/build/repo/node_modules/@storybook/core-server/dist/index.js:23:1840)
3:17:10 PM: ERR!     at async withTelemetry (/opt/build/repo/node_modules/@storybook/core-server/dist/index.js:27:3469)
3:17:10 PM: ERR!     at async build (/opt/build/repo/node_modules/@storybook/cli/dist/generate.js:439:1056)
3:17:10 PM: ERR!     at async Command.<anonymous> (/opt/build/repo/node_modules/@storybook/cli/dist/generate.js:442:125) {
3:17:10 PM: ERR!   indexingErrors: [
3:17:10 PM: ERR!     TSConfckParseError: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: ERR!         at resolveExtends (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13299:9)
3:17:10 PM: ERR!         at parseExtends (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13253:28)
3:17:10 PM: ERR!         at parse$f (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13191:24)
3:17:10 PM: ERR!         at async loadTsconfigJsonForFile (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13751:24)
3:17:10 PM: ERR!         at async transformWithEsbuild (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13438:36)
3:17:10 PM: ERR!         at script (/opt/build/repo/node_modules/@sveltejs/vite-plugin-svelte/src/preprocess.ts:30:26)
3:17:10 PM: ERR!         at process_single_tag (/opt/build/repo/node_modules/svelte/compiler.js:47849:28)
3:17:10 PM: ERR!         at async Promise.all (index 0)
3:17:10 PM: ERR!         at replace_in_code (/opt/build/repo/node_modules/svelte/compiler.js:47737:27)
3:17:10 PM: ERR!         at process_tag (/opt/build/repo/node_modules/svelte/compiler.js:47863:30) {
3:17:10 PM: ERR!       importPaths: [Array]
3:17:10 PM: ERR!     },
3:17:10 PM: ERR!     TSConfckParseError: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: ERR!         at resolveExtends (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13299:9)
3:17:10 PM: ERR!         at parseExtends (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13253:28)
3:17:10 PM: ERR!         at parse$f (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13191:24)
3:17:10 PM: ERR!         at async loadTsconfigJsonForFile (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13751:24)
3:17:10 PM: ERR!         at async transformWithEsbuild (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13438:36)
3:17:10 PM: ERR!         at script (/opt/build/repo/node_modules/@sveltejs/vite-plugin-svelte/src/preprocess.ts:30:26)
3:17:10 PM: ERR!         at process_single_tag (/opt/build/repo/node_modules/svelte/compiler.js:47849:28)
3:17:10 PM: ERR!         at async Promise.all (index 0)
3:17:10 PM: ERR!         at replace_in_code (/opt/build/repo/node_modules/svelte/compiler.js:47737:27)
3:17:10 PM: ERR!         at process_tag (/opt/build/repo/node_modules/svelte/compiler.js:47863:30) {
3:17:10 PM: ERR!       importPaths: [Array]
3:17:10 PM: ERR!     },
3:17:10 PM: ERR!     TSConfckParseError: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: ERR!         at resolveExtends (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13299:9)
3:17:10 PM: ERR!         at parseExtends (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13253:28)
3:17:10 PM: ERR!         at parse$f (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13191:24)
3:17:10 PM: ERR!         at async loadTsconfigJsonForFile (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13751:24)
3:17:10 PM: ERR!         at async transformWithEsbuild (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13438:36)
3:17:10 PM: ERR!         at script (/opt/build/repo/node_modules/@sveltejs/vite-plugin-svelte/src/preprocess.ts:30:26)
3:17:10 PM: ERR!         at process_single_tag (/opt/build/repo/node_modules/svelte/compiler.js:47849:28)
3:17:10 PM: ERR!         at async Promise.all (index 0)
3:17:10 PM: ERR!         at replace_in_code (/opt/build/repo/node_modules/svelte/compiler.js:47737:27)
3:17:10 PM: ERR!         at process_tag (/opt/build/repo/node_modules/svelte/compiler.js:47863:30) {
3:17:10 PM: ERR!       importPaths: [Array]
3:17:10 PM: ERR!     },
3:17:10 PM: ERR!     TSConfckParseError: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: ERR!         at resolveExtends (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13299:9)
3:17:10 PM: ERR!         at parseExtends (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13253:28)
3:17:10 PM: ERR!         at parse$f (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13191:24)
3:17:10 PM: ERR!         at async loadTsconfigJsonForFile (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13751:24)
3:17:10 PM: ERR!         at async transformWithEsbuild (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13438:36)
3:17:10 PM: ERR!         at script (/opt/build/repo/node_modules/@sveltejs/vite-plugin-svelte/src/preprocess.ts:30:26)
3:17:10 PM: ERR!         at process_single_tag (/opt/build/repo/node_modules/svelte/compiler.js:47849:28)
3:17:10 PM: ERR!         at async Promise.all (index 0)
3:17:10 PM: ERR!         at replace_in_code (/opt/build/repo/node_modules/svelte/compiler.js:47737:27)
3:17:10 PM: ERR!         at process_tag (/opt/build/repo/node_modules/svelte/compiler.js:47863:30) {
3:17:10 PM: ERR!       importPaths: [Array]
3:17:10 PM: ERR!     },
3:17:10 PM: ERR!     TSConfckParseError: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: ERR!         at resolveExtends (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13299:9)
3:17:10 PM: ERR!         at parseExtends (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13253:28)
3:17:10 PM: ERR!         at parse$f (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13191:24)
3:17:10 PM: ERR!         at async loadTsconfigJsonForFile (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13751:24)
3:17:10 PM: ERR!         at async transformWithEsbuild (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13438:36)
3:17:10 PM: ERR!         at script (/opt/build/repo/node_modules/@sveltejs/vite-plugin-svelte/src/preprocess.ts:30:26)
3:17:10 PM: ERR!         at process_single_tag (/opt/build/repo/node_modules/svelte/compiler.js:47849:28)
3:17:10 PM: ERR!         at async Promise.all (index 0)
3:17:10 PM: ERR!         at replace_in_code (/opt/build/repo/node_modules/svelte/compiler.js:47737:27)
3:17:10 PM: ERR!         at process_tag (/opt/build/repo/node_modules/svelte/compiler.js:47863:30) {
3:17:10 PM: ERR!       importPaths: [Array]
3:17:10 PM: ERR!     },
3:17:10 PM: ERR!     TSConfckParseError: failed to resolve "extends":"./.svelte-kit/tsconfig.json" in /opt/build/repo/tsconfig.json
3:17:10 PM: ERR!         at resolveExtends (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13299:9)
3:17:10 PM: ERR!         at parseExtends (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13253:28)
3:17:10 PM: ERR!         at parse$f (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13191:24)
3:17:10 PM: ERR!         at async loadTsconfigJsonForFile (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13751:24)
3:17:10 PM: ERR!         at async transformWithEsbuild (file:///opt/build/repo/node_modules/vite/dist/node/chunks/dep-79892de8.js:13438:36)
3:17:10 PM: ERR!         at script (/opt/build/repo/node_modules/@sveltejs/vite-plugin-svelte/src/preprocess.ts:30:26)
3:17:10 PM: ERR!         at process_single_tag (/opt/build/repo/node_modules/svelte/compiler.js:47849:28)
3:17:10 PM: ERR!         at async Promise.all (index 0)
3:17:10 PM: ERR!         at replace_in_code (/opt/build/repo/node_modules/svelte/compiler.js:47737:27)
3:17:10 PM: ERR!         at process_tag (/opt/build/repo/node_modules/svelte/compiler.js:47863:30) {
3:17:10 PM: ERR!       importPaths: [Array]
3:17:10 PM: ERR!     }
3:17:10 PM: ERR!   ]
3:17:10 PM: ERR! }
3:17:10 PM: error Command failed with exit code 1. (https://ntl.fyi/exit-code-1)
3:17:10 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
3:17:10 PM: ​
3:17:10 PM:   "build.command" failed                                        
3:17:10 PM: ────────────────────────────────────────────────────────────────
3:17:10 PM: ​
3:17:10 PM:   Error message
3:17:10 PM:   Command failed with exit code 1: yarn build-storybook (https://ntl.fyi/exit-code-1)
3:17:10 PM: ​
3:17:10 PM:   Error location
3:17:10 PM:   In build.command from netlify.toml:
3:17:10 PM:   yarn build-storybook
3:17:10 PM: ​
3:17:10 PM:   Resolved config
3:17:10 PM:   build:
3:17:10 PM:     command: yarn build-storybook
3:17:10 PM:     commandOrigin: config
3:17:10 PM:     publish: /opt/build/repo/storybook-static
3:17:10 PM:     publishOrigin: config
3:17:11 PM: Caching artifacts
3:17:11 PM: Started saving node modules
3:17:11 PM: Finished saving node modules
3:17:11 PM: Started saving build plugins
3:17:11 PM: Finished saving build plugins
3:17:11 PM: Started saving corepack cache
3:17:11 PM: Finished saving corepack cache
3:17:11 PM: Started saving yarn cache
3:17:16 PM: Finished saving yarn cache
3:17:16 PM: Started saving pip cache
3:17:16 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
3:17:16 PM: Finished saving pip cache
3:17:16 PM: Started saving emacs cask dependencies
3:17:16 PM: Finished saving emacs cask dependencies
3:17:16 PM: Started saving maven dependencies
3:17:16 PM: Finished saving maven dependencies
3:17:16 PM: Started saving boot dependencies
3:17:16 PM: Finished saving boot dependencies
3:17:16 PM: Started saving rust rustup cache
3:17:16 PM: Finished saving rust rustup cache
3:17:16 PM: Started saving go dependencies
3:17:16 PM: Finished saving go dependencies
3:17:16 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:17:16 PM: Failing build: Failed to build site
3:17:16 PM: Finished processing build request in 36.178s

@FoodlyEric
Copy link

FoodlyEric commented Mar 27, 2023

seems like adding "prepack": "svelte-kit sync", fixes the issue, this should be part of default template if this is how you fix the build error on netlify.

babakfp added a commit to babakfp/scrollephant that referenced this issue May 11, 2023
@jetaggart
Copy link

This just bit me on vercel, seems like it should be in the default project template.

@vojtechmarek-dev
Copy link

Happened to me too on Vercel.

@uranderu
Copy link
Author

uranderu commented May 16, 2023 via email

@vojtechmarek-dev
Copy link

vojtechmarek-dev commented May 16, 2023

Yes. Just recently created. The project is really basic. It was created with npm create svelte@latest app command.

Are these new projects?

On May 15, 2023, 23:41, at 23:41, "Vojtěch Marek" @.> wrote: Happened to me too on Vercel. -- Reply to this email directly or view it on GitHub: #5390 (comment) You are receiving this because you modified the open/close state. Message ID: @.>

velut added a commit to velut/gridify.it that referenced this issue May 23, 2023
@bitdom8
Copy link

bitdom8 commented Jul 2, 2023

After new updates, getting some errors on build. Node-adaptor creates .svelte-kit folder

@sheecegardezi
Copy link

still getting this error:

	"@sveltejs/adapter-auto": "^2.1.0",
	"@sveltejs/adapter-static": "^1.0.6",
	"@sveltejs/kit": "^1.22.3",
	"prettier": "^3.0.0",
	"prettier-plugin-svelte": "^3.0.0",
	"svelte": "^4.1.1",
	"svelte-check": "^3.4.6",
	"vite": "^4.4.6"

@benmccann
Copy link
Member

When you create a new project, it's setup as:

	"scripts": {
		"dev": "vite dev",
		"build": "vite build",
		"preview": "vite preview",
		"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
		"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
		"lint": "prettier --plugin-search-dir . --check . && eslint .",
		"format": "prettier --plugin-search-dir . --write .",
		"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest src --config jest.config.json",
		"test:watch": "npm run test -- --watch"
	},

Make sure you have svelte-kit sync in check

@uranderu
Copy link
Author

uranderu commented Jul 24, 2023 via email

@SrGeneroso
Copy link
Contributor

When you create a new project, it's setup as:

	"scripts": {
		"dev": "vite dev",
		"build": "vite build",
		"preview": "vite preview",
		"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
		"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
		"lint": "prettier --plugin-search-dir . --check . && eslint .",
		"format": "prettier --plugin-search-dir . --write .",
		"test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest src --config jest.config.json",
		"test:watch": "npm run test -- --watch"
	},

Make sure you have svelte-kit sync in check

This seems to work for me, Is this going to be the default? TS is kind of a pain, and those kind of warnings are scary for noob devs like me.

@uranderu
Copy link
Author

uranderu commented Jul 30, 2023 via email

Tyneor added a commit to Tyneor/crystal-melt that referenced this issue Aug 27, 2023
@leoj3n
Copy link
Contributor

leoj3n commented Feb 13, 2024

To get rid of the harmless Cannot find base config file ... [tsconfig.json] warning on Vercel, updating the build command like so seems to work for me and my project:

svelte-kit sync && vite build

@aholland
Copy link

aholland commented Mar 4, 2024

TurboRepo users will want to add the line "prepare": "svelte-kit sync", to the scripts section of the package.json file of each relevant workspace, and then add a prepare task to the root turbo.json and depend on it in the build task, as shown below. This way the prepare task should be cached, FWIW.

{
  "$schema": "https://turbo.build/schema.json",
  "pipeline": {
    "build": {
      "dependsOn": ["prepare","^build"],
      "outputs": [".svelte-kit/**", ".vercel/**"]
    },
    "lint": {},
    "prepare": {
      "outputs": [".svelte-kit/**"]
    },
    "dev": {
      "cache": false,
      "persistent": true
    }
  }
}

@yesudeep
Copy link

TurboRepo users will want to add the line "prepare": "svelte-kit sync", to the scripts section of the package.json file of each relevant workspace, and then add a prepare task to the root turbo.json and depend on it in the build task, as shown below. This way the prepare task should be cached, FWIW.

{
  "$schema": "https://turbo.build/schema.json",
  "pipeline": {
    "build": {
      "dependsOn": ["prepare","^build"],
      "outputs": [".svelte-kit/**", ".vercel/**"]
    },
    "lint": {},
    "prepare": {
      "outputs": [".svelte-kit/**"]
    },
    "dev": {
      "cache": false,
      "persistent": true
    }
  }
}

I wonder whether one would have to do something similar for Bazel.

@nickolay
Copy link

nickolay commented Nov 26, 2024

To reiterate what has been said before, the warning is supposed to be harmless. It indicates that whatever build system you use (vercel, netlify, multistage docker builds, ...) didn't populate the .svelte-kit folder before invoking vite build.

The .svelte-kit folder is created by svelte-kit sync from your application source. In modern SK svelte-kit sync will run during npm install (without explicitly being asked to run via "prepare": "svelte-kit sync" in your package.json), so the default workflow (git clone/npm install/npm run build) is NOT expected to produce the warning.

This warning will happen if your build system runs npm install with only package*.json (not the complete application source) in the application directory — e.g. in order to cache node_modules/. In that case it must also run svelte-kit sync manually before vite build (npm run build).

Given that people on different platforms reported different workarounds, it's not really clear what sveltekit is expected to do:

  • vercel: "updating the build command" (in package.json scripts or elsewhere?) to svelte-kit sync && vite build
  • netlify: adding "prepack": "svelte-kit sync",
  • the original reporter: copy the "svelte.config.js" file before I ran "npm install"
    • though running svelte-kit sync before vite build, like for vercel would probably work too — works for me
  • TurboRepo: "prepare": "svelte-kit sync" AND configuring turbo.json

A sensible thing to do IMO would be to extend the default package.json's "scripts" to include "build": "svelte-kit sync && vite build", and say that everyone who doesn't use npm run build must deal with this warning on their own.

But commenting on a closed issue won't help to make it happen.

AlexAxthelm added a commit to RMI-PACTA/pacta-dashboard-svelte that referenced this issue Dec 4, 2024
AlexAxthelm added a commit to RMI-PACTA/pacta-dashboard-svelte that referenced this issue Dec 4, 2024
* Move sample data to `sample-data/` dir

* Split build and (dev) serving docker images

* Update README.md

* Restore `COPY` on `.svelte-kit` directory

* Use `npm run prepare` rather than COPY

See: sveltejs/kit#5390 (comment)

* Formatting

* Move `npm run install` to later in docker build

* Add Docker build action

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

No branches or pull requests

17 participants