Skip to content

bug: functions.source missing error even though it's not missing #206

@Pieter0313

Description

@Pieter0313

Describe the Bug

When running npm run build I get the following error:

error during build:
Error: Error: Required "functions.source" field is missing from Firebase Configuration file.
    at parseFirebaseConfiguration (file:///Users/pieterseegers/Documents/Websites/Avatary/avatary/node_modules/svelte-adapter-firebase/src/utils.js:164:9)
    at adapt (file:///Users/pieterseegers/Documents/Websites/Avatary/avatary/node_modules/svelte-adapter-firebase/src/index.js:26:35)
    at adapt (file:///Users/pieterseegers/Documents/Websites/Avatary/avatary/node_modules/@sveltejs/kit/src/core/adapt/index.js:28:8)
    at Object.handler (file:///Users/pieterseegers/Documents/Websites/Avatary/avatary/node_modules/@sveltejs/kit/src/exports/vite/index.js:611:12)
    at async PluginDriver.hookParallel (file:///Users/pieterseegers/Documents/Websites/Avatary/avatary/node_modules/rollup/dist/es/shared/rollup.js:23582:17)
    at async Object.close (file:///Users/pieterseegers/Documents/Websites/Avatary/avatary/node_modules/rollup/dist/es/shared/rollup.js:24937:13)
    at async Promise.all (index 0)
    at async build (file:///Users/pieterseegers/Documents/Websites/Avatary/avatary/node_modules/vite/dist/node/chunks/dep-5e7f419b.js:44352:13)
    at async CAC.<anonymous> (file:///Users/pieterseegers/Documents/Websites/Avatary/avatary/node_modules/vite/dist/node/cli.js:808:9)

It says that the functions.source field is missing from my firebase configuration file, but it's definitely there;

{
	"firestore": {
		"rules": "firestore.rules",
		"indexes": "firestore.indexes.json"
	},
	"hosting": {
		"predeploy": "npm run build",
		"public": "build",
		"ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
		"rewrites": [
			{
				"source": "**",
				"function": "ssr",
				"region": "europe-west1"
			}
		]
	},
	"functions": [
		{
			"codebase": "default",
			"ignore": ["node_modules", ".git", "firebase-debug.log", "firebase-debug.*.log"],
			"source": "build"
		}
	],
	"storage": {
		"rules": "storage.rules"
	},
	"emulators": {
		"functions": {
			"port": 5001
		},
		"firestore": {
			"port": 8000
		},
		"hosting": {
			"port": 5005
		},
		"storage": {
			"port": 9199
		},
		"ui": {
			"enabled": true
		},
		"singleProjectMode": true
	}
}

Steps to Reproduce

  1. Added the adapter to svelte.config.js;
	kit: {
		adapter: adapter({
		})
	},
  1. Added a functions.source field
  2. Got the error

Expected Behaviour

I think it should recognize this field, but I'm not 100% sure if I'm doing something wrong.

svelte-adapter-firebase version

0.14.4

sveltejs/kit version

1.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions