Why is my function middleware not active?
I created a middleware here: https://github.com/NullVoxPopuli/limber/pull/1733/files
and locally, testing with npx wrangler has the desired behavior.
but when I view my page's latest deploy: https://4186709a.limber-glimmer-tutorial.pages.dev/1-introduction/1-basics
the middleware is not active.
What debugging steps should I try?
Glimmer Tutorial
Interactive tutorial for learning Glimmer, Ember's reactivity and component system, as well as the syntax and patterns needed to be effective in Glimmer and Ember projects.
23 Replies
Do you have a tutorial for how to build it? I'm getting this error:
Appears to be coming from
sync-dependencies-meta-injected
At the root, pnpm i, pnpm build, then cd to that workspace folder, pnpm start, then in a separate terminal pnpm cf in that same folder
Might need node 21
Oop
ERR_PNPM_BAD_PM_VERSION This project is configured to use v8.15.4 of pnpm. Your current pnpm is v9.1.0
Getting this now:
Maybe try reproducing your issue in a new repo from scratch?what node version are you using?
I don't want to. haha
should I be doing more than just putting a
functions
folder in my built output / dist?The functions folder should be in
tutorials
, then you would call wrangler pages dev dist
or wrangler pages deploy dist
ah ok, I'll try that
I was cding in to dist to call wrangler
hm, my deployment specified dist tho:
maybe this is the problem
that
./directory
would have the functions
in itI believe you want
Hm, there isn't really enough log output here to see what happened: https://github.com/NullVoxPopuli/limber/actions/runs/9045738794/job/24855804935#step:3:23
GitHub
Deploy Preview · NullVoxPopuli/limber@9b7ad14
Glimdown playground for documentation, demos, etc. Contribute to NullVoxPopuli/limber development by creating an account on GitHub.
Did it fail? That looks like a success to me?
Or are you looking for something else?
Oh, the functions didn't upload...
Did you add the
workingDirectory
?Yeah:
Weird it isn't logging it... Though also, it is using wrangler 2, which is a full major release behind...
Oh no, i'll try upgrading the action
Looks like the Action is behind too...
Not entirely sure it is maintained...
Oh no. What would you recommend? Just using wrangler directly?
Probably the best idea.
At least for now
oh, how do you do a preview deploy
wrangler
? what's the difference between deploy and publish?
oh maybe deploy is for preview and publish is for the main siteGitHub
Fix workflows · NullVoxPopuli/limber@65a3cf5
Glimdown playground for documentation, demos, etc. Contribute to NullVoxPopuli/limber development by creating an account on GitHub.
I guess I still made a preview deploy
do I just omit the hash when I want a non-preview?
omg it worked!
yay
oh, except my logic is wrong
ha
now all of my gjs requests are 404s
good thing I haven't figured out production deploy
oh no...
but these deploys are production deploys
ug
I'm getting 500 errors, actually
are there logs?
ah
so the response option's headers object is different than locally
or maybe null is just one of the possibilities I need to account for
success!
it was that headers are sometimes null
not headers, content-type, sorry
the 304 case
thanks for your help!
How do I mark this as solved?
nevermind, figured it out
publish is the old command, deploy is the new