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

[Bug?]: Context is empty #11576

Open
1 task
razzeee opened this issue Sep 17, 2024 · 5 comments
Open
1 task

[Bug?]: Context is empty #11576

razzeee opened this issue Sep 17, 2024 · 5 comments
Labels
bug/needs-info More information is needed for reproduction

Comments

@razzeee
Copy link
Contributor

razzeee commented Sep 17, 2024

What's not working?

Context is {} when using it similar to

The interesting this is, that we're still on redwood 7 and it seemed to break for no reason. I was guessing a dependency update, but wasn't able to pinpoint it so far.

It also seems to be fine in dev, but breaks for us with docker/deploy (our own docker stuff, pre redwood docker)

How do we reproduce the bug?

I'm lost on this so far, mostly want to reach out and see, if anything comes to mind. Might task a colleague to condense a repro repo, if nothing else happens.

What's your environment? (If it applies)

System:
    OS: Linux 6.10 Fedora Linux 40 (Workstation Edition)
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 20.16.0 - /tmp/xfs-6b43daa9/node
    Yarn: 4.4.1 - /tmp/xfs-6b43daa9/yarn
  Databases:
    SQLite: 3.45.1 - /usr/bin/sqlite3
  npmPackages:
    @redwoodjs/auth-custom-setup: 7.7.4 => 7.7.4 
    @redwoodjs/cli-data-migrate: 7.7.4 => 7.7.4 
    @redwoodjs/cli-storybook: 7.7.4 => 7.7.4 
    @redwoodjs/cli-storybook-vite: 7.7.4 => 7.7.4 
    @redwoodjs/core: 7.7.4 => 7.7.4 
  redwood.toml:
    [web]
      title = "slashskills"
      port = 8910
      apiUrl = "/.redwood/functions" # you can customise graphql and dbauth urls individually too: see https://redwoodjs.com/docs/app-configuration-redwood-toml#api-paths
      sourceMap = true
      includeEnvironmentVariables = [
        "GITLAB_CLIENT_ID",
        "GITLAB_REDIRECT_URI",
        "GITLAB_AUTHORITY",
        "SITE_ID",
        "BASE_URL",
        "SENTRY_DSN",
        "ENVIRONMENT",
        "SENTRY_ENABLED",
        "CI_COMMIT_SHA",
      ] # any ENV vars that should be available to the web side, see https://redwoodjs.com/docs/environment-variables#web
    [api]
      port = 8911
      host = "localhost"
    [browser]
      open = true

Are you interested in working on this?

  • I'm interested in working on this
@razzeee razzeee added the bug/needs-info More information is needed for reproduction label Sep 17, 2024
@ahaywood
Copy link
Contributor

@razzeee Thanks for reporting! This looks so strange. I'm tagging @Josh-Walker-GM and @Tobbe to see if they have any ideas or have seen anything similar?

@Tobbe
Copy link
Member

Tobbe commented Sep 18, 2024

Nothing that comes to mind right now I'm afraid

@cannikin
Copy link
Member

Any more details? That code snippet is within dbAuth itself, which you normally don’t have access to within an app. Where are you accessing context and seeing that it’s equal to {}?

@razzeee
Copy link
Contributor Author

razzeee commented Sep 18, 2024

I figured out how to get it to work again, but I'm not 100% sure, which part the actual fix was

We have had a docker setup since before it was available with redwood

RUN yarn global add @redwoodjs/cli prisma @sentry/cli && \
  prisma generate [...]

If I pin it like this, it starts working again:

RUN yarn global add @redwoodjs/[email protected] [email protected] @sentry/cli && \

The prisma pin might actually not be needed, it started to work, after pinning the cli (we can probably pin something newer)

@arimendelow
Copy link
Contributor

@razzeee, can you provide a small repo with a reproduction of this issue? And I echo @cannikin's question — where are you attempting to access context?

The only time I've seen context be unexpectedly empty is when experiencing cookie issues, though without more information it's tough to know what the issue could be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/needs-info More information is needed for reproduction
Projects
None yet
Development

No branches or pull requests

5 participants