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]: "[error] Translation namespaces" #212

Open
Jipem opened this issue Jan 18, 2025 · 27 comments · May be fixed by #223
Open

[Bug]: "[error] Translation namespaces" #212

Jipem opened this issue Jan 18, 2025 · 27 comments · May be fixed by #223
Assignees
Labels

Comments

@Jipem
Copy link

Jipem commented Jan 18, 2025

Extension Version

0.1.18

PHP Binary

Local PHP

Operating System

Windows

What happened?

On start of Visual Studio Code :

2025-01-18 20:03:35.974 [info] Checking herd PHP installation: herd which-php
2025-01-18 20:03:35.975 [info] Checking valet PHP installation: valet which-php
2025-01-18 20:03:35.975 [info] Checking local PHP installation: php -r 'echo PHP_BINARY;'
2025-01-18 20:03:35.975 [info] Checking sail PHP installation: ./vendor/bin/sail ps
2025-01-18 20:03:35.975 [info] Falling back to system PHP installation
2025-01-18 20:03:35.975 [error] Translation namespaces

Error: __VSCODE_LARAVEL_START_OUTPUT__
   BadMethodCallException 

  Method Illuminate\Filesystem\Filesystem::json does not exist.

  at D:\jipem\Sites\laragon\www\laravel\vendor\laravel\framework\src\Illuminate\Macroable\Traits\Macroable.php:113
    109▕      */
    110▕     public function __call($method, $parameters)
    111▕     {
    112▕         if (! static::hasMacro($method)) {
  ➜ 113▕             throw new BadMethodCallException(sprintf(
    114▕                 'Method %s::%s does not exist.', static::class, $method
    115▕             ));
    116▕         }
    117▕

  i   Bad Method Call: Did you mean Illuminate\Filesystem\Filesystem::extension() ? 

  1   D:\jipem\Sites\laragon\www\laravel\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:338
      Illuminate\Filesystem\Filesystem::__call("json")

  2   D:\jipem\Sites\laragon\www\laravel\vendor\_laravel_ide\discover-9bf70685f88c341f6dfa31892eff8be2.php:94
      Illuminate\Support\Facades\Facade::__callStatic("json")

2025-01-18 20:03:35.978 [info] Activating Laravel Extension...
2025-01-18 20:03:35.978 [info] Started

Mimimal Code Sample

@HassanZahirnia
Copy link

I'm also getting a similar error on WSL2 (Ubuntu)

Image

Version number is 0.1.18

@patimio66
Copy link

Got similar error, Windows 11, latest.
Image

Version number is 0.1.18

@geraistec
Copy link

Same error!

Debian 12.

Image

@LukaszJaro
Copy link

Same error as @patimio66 running on windows 10. Just installed the extension today.

@slaanish
Copy link

Same issue as the others, Windows 11 WSL, Right clicking the extension and selecting 1.17 no longer errors.

Image

@slaanish
Copy link

Taking a look between 1.17 and 1.18, I do see there was a merge that did target language. I do not even pretend to know what is going on, but it does touch language processing and happened between working version and now. All of us appear to be on Windows... A pathing issue? \ vs /

d0f299c

@otavio-araujo
Copy link

Yep, it works!

@andreg
Copy link

andreg commented Jan 28, 2025

I'm getting the same error as @patimio66, running on MacOS. Downgrading to 1.17 does apparently fix the issue though.

@Braunson
Copy link

Braunson commented Jan 28, 2025

Same issue on Windows (Sail via WSL) in version 0.1.18

@daronspence
Copy link

Can confirm this is still an issue on 0.1.18 on macOS. I tried running the generated vendor file directly with some more dd() statements and try/catch for good measure, but I couldn't trace it down.

Downgrading to version 0.1.17 at least stopped the extension from crashing. I was hoping that disabling the Translation options in the extension settings would skip the initialisation, but that seems to not be the case.

The JSON files are valid, though some strings do include HTML. Idk if that may be throwing off a parser somewhere?

@joetannenbaum
Copy link
Collaborator

I removed the File::json call from the translations repo in v0.1.19, just released. Does that solve this issue or is it still present in the latest version?

@Braunson
Copy link

Braunson commented Feb 11, 2025

@joetannenbaum Same issue (not the same error as OP but translation related) on 0.1.19. Errors out after [info] Started and the error (at least the start of the very long string) is Translation namespaces __VSCODE_LARAVEL_START_OUTPUT__ followed by an output of the en translation JSON.

@chosten
Copy link

chosten commented Feb 11, 2025

Still present: Error: __VSCODE_LARAVEL_START_OUTPUT__{"default":"en","translations"...

@mmuqiitf
Copy link

I hope this patch anytime soon because it's really annoying, i always click don't show again

Image

@mokhosh
Copy link

mokhosh commented Feb 12, 2025

Still getting it on .19

@otavio-araujo
Copy link

otavio-araujo commented Feb 12, 2025 via email

@joetannenbaum
Copy link
Collaborator

Would love to get to the bottom of this, I find it strange that you're getting JSON back but it's still erroring. Does anyone have a public repo I can pull down that replicates this?

@patimio66
Copy link

@joetannenbaum maybe it's related to VS Code locale? Like to the settings of VS code?

@priithansen
Copy link

My preliminary testing seems to suggest it's not a particular line or language file causing this error but the amount of translation strings. Seemed that there was a certain amount of lines needed (tested with validation translations) to cause this error to appear. Didn't seem matter which particular lines where present.

@joetannenbaum
Copy link
Collaborator

My preliminary testing seems to suggest it's not a particular line or language file causing this error but the amount of translation strings. Seemed that there was a certain amount of lines needed (tested with validation translations) to cause this error to appear. Didn't seem matter which particular lines where present.

Yeah this is what I suspected. I'm tempted to add a setting to omit vendor translations, although I'd love to also have a solution to have them properly included as well. I'll continue investigating.

@duncanmcclean
Copy link

Does anyone have a public repo I can pull down that replicates this?

We have a lot of translation strings in our app/package (Statamic). I can see the error on any Statamic site I touch.

@joetannenbaum
Copy link
Collaborator

Does anyone have a public repo I can pull down that replicates this?

We have a lot of translation strings in our app/package (Statamic). I can see the error on any Statamic site I touch.

Yup, seeing that too with a fresh install just now. Good place to start, thanks @duncanmcclean 👍

@joetannenbaum
Copy link
Collaborator

Just released v0.1.20 that should greatly improve (if not fix) this issue. I completely overhauled the translations collection process and the performance + memory usage is much better now.

Let me know how it looks on your end!

@patimio66
Copy link

@joetannenbaum looks good on my side! Tried installing the extension from scratch, again, works fine on v0.1.20.

Image

@slaanish
Copy link

Issues resolved for me as well, thanks!

@ghabriel25
Copy link

@joetannenbaum New error. I tried reinstall have the same error

Image

@mokhosh
Copy link

mokhosh commented Feb 14, 2025

Resolved for me too. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.