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

Edge deployment failures #2572

Closed
zachleat opened this issue Sep 22, 2022 · 11 comments
Closed

Edge deployment failures #2572

zachleat opened this issue Sep 22, 2022 · 11 comments
Labels
breaking-change-canary This applied a breaking change in a canary release. feature: 🧀 edge The Eleventy Edge plugin release: canary A release on the canary channel

Comments

@zachleat
Copy link
Member

zachleat commented Sep 22, 2022

It looks like deployments relying on the Eleventy generated import map for Edge are failing. We are going to have to workaround the approach which uses the autogenerated import map. This will allow us to delete some code but will also unfortunately require Edge function import statements to change (again).

This will apply to 2.0.0-canary.16 and newer.

Before

import { EleventyEdge } from "eleventy:edge";
import precompiledAppData from "./_generated/eleventy-edge-app-data.js";

After

import { EleventyEdge, precompiledAppData } from "./_generated/eleventy-edge-app.js";

Error message

We’ll also throw a build-time error message for you with instructions:

Experimental early adopter API change alert! Unfortunately the default imports for Eleventy Edge in the latest canary have changed. The easiest thing you can do is delete your existing netlify/edge-functions/eleventy-edge.js and let Eleventy generate a new one for you. The new import should be import { EleventyEdge, precompiledAppData } from "./_generated/eleventy-edge-app.js";

Shout outs

cc @mirisuzanne and @slegay and @MarcL who seem to have been asking around on this one!

(Also ran into #2571 while debugging this)

@zachleat zachleat added breaking-change This will have to be included with a major version as it breaks backwards compatibility. feature: 🧀 edge The Eleventy Edge plugin labels Sep 22, 2022
@zachleat zachleat added this to the Eleventy 2.0.0 milestone Sep 22, 2022
@zachleat zachleat added the release: canary A release on the canary channel label Sep 22, 2022
@zachleat
Copy link
Member Author

Shipping with 2.0.0-canary.16

@mirisuzanne
Copy link

Thanks for the update! Excited to try it out again. :)

@MarcL
Copy link

MarcL commented Sep 22, 2022

Thanks for the quick fix @zachleat! I really appreciate the debugging today. 🎉

@zachleat
Copy link
Member Author

zachleat commented Sep 22, 2022

Cross posting 11ty/demo-eleventy-edge#1 from @slegay

@zachleat
Copy link
Member Author

2.0.0-canary.16 has shipped.

zachleat added a commit to 11ty/11ty-website that referenced this issue Sep 23, 2022
@slegay
Copy link

slegay commented Sep 23, 2022

Awesome, thanks so much!

@slegay
Copy link

slegay commented Sep 23, 2022

By the way, 11ty Edge is game changing. We're going to be able to serve our gated content to our world-wide audience over CDN with 200ms response times. Authentication tokens are handled via JWTs in cookies that refresh every 15 minutes and validated in edge functions, the user token gets injected as global data into 11ty Edge rendering, and all personalization and signing of video stream URLs happen in 11ty Edge, the whole thing works flawlessly. The only request requiring access backend data is the one refreshing the JWT with a serverless function. No client JS framework, just plain old HTML and a few web components. Really cool stuff.

@MarcL
Copy link

MarcL commented Sep 23, 2022

I'd love to hear more about your approach here @slegay. We love success stories about teams using Netlify edge functions (and I love hearing how 11ty can be used too!) Your use case sounds really interesting. Reach out if you'd like to chat about it sometime.

@slegay
Copy link

slegay commented Sep 26, 2022

Hey Marc, sure, would love to chat! I just sent you a connection request on LinkedIn.

@zachleat zachleat added breaking-change-canary This applied a breaking change in a canary release. and removed breaking-change This will have to be included with a major version as it breaks backwards compatibility. labels Jan 10, 2023
@Kerrick
Copy link

Kerrick commented Apr 14, 2023

Hey Marc, sure, would love to chat! I just sent you a connection request on LinkedIn.

Would you be willing to post a link to a public write-up? I'm also curious how you did this and I'm sure I'm not the only one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change-canary This applied a breaking change in a canary release. feature: 🧀 edge The Eleventy Edge plugin release: canary A release on the canary channel
Projects
None yet
Development

No branches or pull requests

5 participants