Closed GoodGoodJM closed 1 year ago
I attached relevant part of code to logs.
// ./src/routes/+layout.svelte
<script lang="ts">
import { getAuth, onIdTokenChanged } from 'firebase/auth';
import { onMount } from 'svelte';
import '$lib/firebase/client';
import '../app.css';
import { userContext } from '$lib/context/user';
import type { LayoutData } from './$types';
/** ... */
I doubt solely switching adapters would've changed how your svelte file is getting parsed. You might've messed something up in the migration, eg: you pasted in the config from docs and accidentally removed the preprocessor.
Otherwise you need to provide a minimal reproduction for us to know what the problem is as you were instructed by the issue template.
Please provide a proper reproduction for the issue as instructed by the issue template:
A link to a repository, or a fork of https://node.new/sveltekit, that reproduces the issue. Reproductions must be short, self-contained and correct and must not contain files or code that aren't relevant to the issue — please do NOT just paste a link to your project. Explaining how to reproduce is generally not enough. It pushes the burden of creating a reproduction project onto a small set of volunteer maintainers and isn't scalable. If no reproduction is provided, the issue will be closed.
@gtm-nayan Yes, you are right. I accidentally deleted the preprocessor, and since I restored it, it goes a little further.
> Using @sveltejs/adapter-cloudflare
✘ [ERROR] Could not resolve "@firebase/database-compat/standalone"
node_modules/firebase-admin/lib/app/firebase-namespace.js:106:41:
106 │ return Object.assign(fn, require('@firebase/database-compat/standalone'));
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The path "./standalone" is not currently exported by package "@firebase/database-compat":
node_modules/@firebase/database-compat/package.json:16:13:
16 │ "exports": {
╵ ^
None of the conditions provided ("types", "node") match any of the currently active conditions
("browser", "default", "require", "worker"):
node_modules/@firebase/database-compat/package.json:27:20:
27 │ "./standalone": {
╵ ^
Consider enabling the "types" condition if this package expects it to be enabled. You can use
"conditions: ['types']" to do that:
node_modules/@firebase/database-compat/package.json:28:6:
28 │ "types": "./dist/database-compat/src/index.standalone.d.ts",
╵ ~~~~~~~
You can mark the path "@firebase/database-compat/standalone" as external to exclude it from the
bundle, which will remove this error. You can also surround this "require" call with a try/catch
block to handle this failure at run-time instead of bundle-time.
✘ [ERROR] Could not resolve "fs"
...
...
...
The package "fs" wasn't found on the file system but is built into node. Are you trying to bundle
for node? You can use "platform: 'node'" to do that, which will remove this error.
error during build:
Error: Build failed with 94 errors:
node_modules/@fastify/busboy/deps/dicer/lib/Dicer.js:3:31: ERROR: Could not resolve "stream"
node_modules/@fastify/busboy/deps/dicer/lib/HeaderParser.js:3:29: ERROR: Could not resolve "events"
node_modules/@fastify/busboy/deps/dicer/lib/PartStream.js:4:31: ERROR: Could not resolve "stream"
node_modules/@fastify/busboy/deps/streamsearch/sbmh.js:29:29: ERROR: Could not resolve "events"
node_modules/@fastify/busboy/lib/main.js:3:31: ERROR: Could not resolve "stream"
Again, we need a minimum reproducible to look into this. Creating the minimum reproducible might also reveal that the issue is unrelated to SvelteKit and fix it directly on your end.
https://github.com/firebase/firebase-admin-node/issues/2069
I think it should be solved in firebase-admin, I realized it during the reproduction. Thank you to those who have responded to this issue.
Describe the bug
Our project hosted on vercel. We decide move to cloudflare.
We checked docs(https://kit.svelte.dev/docs/adapter-cloudflare, https://developers.cloudflare.com/pages/framework-guides/deploy-a-svelte-site/) and install adapter and try to build(
"build": "CF_PAGES=1 vite build"
)But build occur error and logs(see attached logs).
In my opinion, the compiler can't compile the ts.
Reproduction
install @sveltejs/adapter-cloudflare and build(
"build": "CF_PAGES=1 vite build"
)Logs
System Info
Severity
blocking all usage of SvelteKit
Additional Information
No response