-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
@astrojs/lit breaks @astrojs/cloudflare builds #42
Comments
I believe I've narrowed this down to the package.json {
"name": "lit-html",
"version": "2.7.2",
"description": "HTML templates literals in JavaScript",
"license": "BSD-3-Clause",
"repository": {
"type": "git",
"url": "https://github.com/lit/lit.git",
"directory": "packages/lit-html"
},
"author": "Google LLC",
"homepage": "https://lit.dev/",
"main": "lit-html.js",
"type": "module",
"exports": {
".": {
"types": "./development/lit-html.d.ts",
"node": {
"development": "./node/development/lit-html.js",
"default": "./node/lit-html.js"
},
"development": "./development/lit-html.js",
"default": "./lit-html.js"
},
"./async-directive.js": {
"types": "./development/async-directive.d.ts",
"node": {
"development": "./node/development/async-directive.js",
"default": "./node/async-directive.js"
},
"development": "./development/async-directive.js",
"default": "./async-directive.js"
},
... It appears that import { defineConfig } from 'astro/config';
import cloudflare from '@astrojs/cloudflare';
import tailwind from "@astrojs/tailwind";
import lit from "@astrojs/lit";
// https://astro.build/config
export default defineConfig({
output: 'server',
integrations: [
tailwind(),
lit(),
],
adapter: cloudflare({ mode: 'directory' }),
vite: {
ssr: {
noExternal: [
'@lit/reactive-element',
'lit-html',
'lit',
],
},
resolve: {
conditions: ['node'],
},
},
}); |
This should be resolved with this PR: |
Can we confirm that this is still an issue. |
Closing because it is stale & superseded by #56 |
What version of
astro
are you using?2.3.0
Are you using an SSR adapter? If so, which one?
Cloudflare
What package manager are you using?
yarn
What operating system are you using?
Mac
What browser are you using?
Brave
Describe the Bug
When deploying via GitHub, the astro project builds successfully, but fails at deploying the CF function.
No lit components are used in the project; simply adding lit to the integrations field in the config seems to break deployments.
The error from Cloudflare:
Error: Failed to publish your Function. Got error: Uncaught ReferenceError: window is not defined at functionsWorker-xxxx.js:2140:10
A snippet of what could be the offending code in the build:
This is apparently from the Lit library itself.
I'll keep digging in to see what I can find out, but I'd greatly appreciated any help!
Link to Minimal Reproducible Example
https://github.com/chaffinated/astro-lit-cloudflare-repro
Participation
The text was updated successfully, but these errors were encountered: