Skip to content

Errors regarding devMode and prodMode on Windows OS #737

Description

@mathsgod

I've discovered that errors occur in DEV MODE while testing in a PHP8.1 environment. For reference, please check my repository: https://github.com/mathsgod/graphqlite-test.

The same QUERY that results in an error in DEV MODE does not produce errors in prod modes.

When the cache is cleared, the first EXECUTE QUERY runs successfully and returns the correct result. However, subsequent executions of the same QUERY, when the cache is present, result in an ERROR.

I am considering whether the issue could be related to the use of Symfony cache or other potential causes.

I think the cache in GlobControllerQueryProvider is causing it to not find the QUERY's controller, which leads to this ERROR.

Activity

  1. oprypkhantc commented on Mar 13, 2025

    @oprypkhantc
    Contributor

    Cannot reproduce that.

    Image

    I've made sure that cache is saved by setting a directory: $cache = new Psr16Cache(new FilesystemAdapter(directory: '/app/cache/dev'));, and ran it with docker run -it --rm -v $PWD:/app -w /app chialab/php-dev:8.2 php devmode.php. Running it multiple times does generate cache, but always results in the same output.

  2. mathsgod commented on Mar 14, 2025

    @mathsgod
    Author

    Indeed, I had no issues when testing in the LINUX environment (php8.2). I discovered that this problem only occurs in the WINDOWS environment. I also tested the same thing on another WINDOWS computer and changed the cache directory. In the cache folder, there were cache files, but the output still showed the same error.

    Image

  3. changed the title [-]Errors regarding devMode and prodMode[/-] [+]Errors regarding devMode and prodMode on Windows OS[/+] on Mar 14, 2025
  4. oprypkhantc commented on Mar 14, 2025

    @oprypkhantc
    Contributor

    Possibly has something to do with path handling in these namespaces, but that's just guessing: https://github.com/thecodingmachine/graphqlite/tree/master/src/Cache
    https://github.com/thecodingmachine/graphqlite/tree/master/src/Discovery

  5. guugg commented on Nov 15, 2025

    @guugg

    So far, this problem has existed.
    The WSL2 test is normal. Cache is stored as '/', so this is causing Windows to have this problem?

    My current solution is to not cache on Windows

      if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
        // Window environment configuration
        $cache = new Psr16Cache(new NullAdapter());
      } else { 
        $cache = new Psr16Cache(new FilesystemAdapter(
          // Linux environment configuration
        ));
      } 
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions