-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Middleware intermittently not working on iOS/ARM #8191
Comments
@ematipico I think you closed this a little too hastily.. :( |
Even with |
Here's a StackBlitz repro, which definitely seems to be working. @ZeldOcarina could you run |
Of course!!
|
Couldn't reproduce on windows or linux. |
@ZeldOcarina it's possible that your terminal doesn't log for some reason. Why don't you try to use it by doing writing something into |
Hi! All logs on standard routes etc. work properly. It's only the middleware that is not running at all, it's so weird.. |
Did you check if the middleware gets executed? |
I did by hardcoding some locals and no locals are being passed down to the components etc.. |
Could you upload the dist folder somewhere, maybe in a branch. That would at least rule out an astro bug from something about your environment. |
Of course! |
Ah, it's a static build. It maybe worth adding an adapter ( |
Ok done! |
Ok, I see what you see now — not "Request received!". Building again myself runs the middleware and logs to the console. Not sure what the issue is. Best guess: you need to reinstall astro, or node. Run npm and other commands in a container if that doesn't work. |
That's super weird.. I even tried with Bun and yarn.. |
I can confirm building in a Codespace container is working. |
It's hard to investigate because as far as I can tell, the cause is is somewhere on your system. |
I will try to open a remote M1 from a service I know and see if I can reproduce there.. it may be something that has to do with the ARM architecture.. |
I think the best course of action is creating a thread on discord, in the support channel, and chat with people there. This seems to be an issue specific to someone machine/environment and unfortunately it's very hard to debug unless you do it yourself from the source code. I have a M2 and I can't see this issue. Weird. |
Ha I got it! |
I don't think there's much we can do. This is something related to your machine and environment, I can't look for an external hard drive 😅 |
Wow that is very strange! I have no idea what could be causing this problem when running on an external SSD. I agree that there's probably not much we can do, since it seems so environment specific... I tried searching through Vite, Rollup, Node issues but can't seem to find anything similar to this either. |
There is this one issue: #8164 (comment). |
Hello @ZeldOcarina. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with |
@lilnasy I think you do have a reproduction repo, let's not be too picky on that.. issue should not be closed.. |
So far I thought the linked repo would reproduce the issue on an external disk. But if someone is encountering the bug without it, there's probably another factor to consider. Either way, I marked it as need repro because it's not an actionable issue, it's just going to sit here. |
Ok thanks! :) |
here is my install detail
i get this dependencies in package.json
now i got this issue no 'middleware' but only 'page' in terminal log seems like my onRequest didn't work 🫠. did i miss any step or do anything wrong ?? I publish this folder to a github repo. can anyone test if this is my personal issue. thanks for reading this long post. glad to get any advice. |
@WinnieS0728 Pretty sure it's something about your (and ZeldOcarina's) system. |
@WinnieS0728 Your investigation might be really helpful! You have traditional chinese characters in the path in the first case where you encounter the issue. Could you post a screenshot where you run the And see if adding a chinese character to the |
chinese characters new folderpwd english characters new folderpwd chinese characters new folder in github folderpwd english characters new folder in github folderpwd direct inside github folderpwd seems like only work direct inside github folder |
Could you remove spaces from this folder. Maybe |
@ZeldOcarina Is there a space in the full path in your project? |
so i think maybe is not personal issue ? I don't know about detail, but I'm guessing is something like astro compiler detect folder name when build running env can't read space or chinese ? |
@WinnieS0728 The fix in #8614 should work for chinese characters as well. |
how about the space. in my case i typed space almost 80% of my project if name have more than 1 words. the chinese characters '未命名檔案夾' is means 'unnamed folder', and it's the default name when create a new folder in my mac. i almost never use chinese characters in my projects. |
Both spaces and non-english characters are fixed. |
Thank you so so so much. I search this issue almost a day around google, youtube and even Bing AI. no one have same issue 🫠. thanks for your help. |
Thank you, you're the one who figured what the problem even is! Fixing is the easy part. |
whoo whoo thanks a bunch @lilnasy @WinnieS0728 ! |
What version of
astro
are you using?latest
Are you using an SSR adapter? If so, which one?
No
What package manager are you using?
npm
What operating system are you using?
Mac
What browser are you using?
Chrome
Describe the Bug
I have a tried a clean install of Astro with npm create astro@latest but I just cannot get my
middleware.ts
to run.I need to pass to components some context data and perform some global transformations on my response data but cannot do that.
What's the expected result?
Middleware running correctly.
Not flagging willing to submit a pull request as I would not know where to start from.
Link to Minimal Reproducible Example
https://github.com/ZeldOcarina/astro-middleware-bug
Participation
The text was updated successfully, but these errors were encountered: