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

"Expected Nothing" in all JSON files and NBT tags #1609

Open
Lunaticol opened this issue Sep 30, 2024 · 16 comments
Open

"Expected Nothing" in all JSON files and NBT tags #1609

Lunaticol opened this issue Sep 30, 2024 · 16 comments

Comments

@Lunaticol
Copy link

I keep getting "expected nothing" errors on all of my tags. from my knowledge these tags should be correct as they load perfectly fine in game. image

@misode
Copy link
Member

misode commented Sep 30, 2024

Could you run the Spyglass: Show Output command (after bringing up the command palette with Ctrl+Shift+P), and then share that log file here?

@Lunaticol
Copy link
Author

https://mclo.gs/9ZkLyjP

@misode
Copy link
Member

misode commented Sep 30, 2024

Can you try resetting your project cache? You can do this by running the Spyglass: Reset Project Cache command. You may need to reload vscode and/or close all opened files afterwards.

If this doesn't fix it, you can try the second option: Run the Spyglass Open Cache Folder command, close vscode, and then delete everything in the cache folder.

@Lunaticol
Copy link
Author

Resetting and Clearing the cache did not work. it all just tells me the same error agian

@misode
Copy link
Member

misode commented Oct 7, 2024

Do you only have this issue with tags? Or also with other json files or NBT in mcfunctions?

@Lunaticol
Copy link
Author

I'm only seeing it effect my Functions and Tags
Image

@Lunaticol
Copy link
Author

Lunaticol commented Oct 23, 2024

affects advancements to
Image

@Lunaticol
Copy link
Author

affects recipes to Image

@Tschipcraft
Copy link

Tschipcraft commented Nov 23, 2024

Happens to me as well, but only on one project I'm working on. Resetting the cache did not work.
Affects tags, advancements, pack.mcmeta, json after tellraw+particle and NBT in mcfunction. External json files are unaffected.
My log: https://mclo.gs/VYTd5uV

@misode
Copy link
Member

misode commented Nov 23, 2024

@Tschipcraft Thanks for the info! I still have very little idea what causes this. Could you try the following:

  1. Run Spyglass: Open Cache Folder -> This should open C:/Users/********/AppData/Local/spyglassmc-nodejs/Cache/
  2. Uninstall the "Datapack Helper Plus by Spyglass" vscode extension from the Vscode menu
  3. Close all open windows of Vscode
  4. Remove everything in the cache folder from above
  5. Go to C:\Users\********\.vscode\extensions and remove the extension folder that starts with spgoding.datapack-language-server-
  6. Reopen Vscode in your project folder and re-install the "Datapack Helper Plus by Spyglass" extension
  7. When Spyglass is done initializing, please share the log again if it is still not working.

@Lunaticol
Copy link
Author

log.txt
The odd thing is that it works fine in other datapacks??? Ive even moved everything out of the specific datapack it was bugging in and the copied folders work just fine outside of the datapack I'm working on. I have even deleted the entire thing and re-copied it from github and still get errors.

@Tschipcraft
Copy link

I tried, but same problems. My log: https://mclo.gs/7bZQUEa
Maybe it's reproducible? You could try cloning https://github.com/sa-shiro/spawnanimations/tree/1.20.5 and test on your end

@misode
Copy link
Member

misode commented Nov 24, 2024

Were both of those logs from the first restart after following all those steps? Because I still see Skipped thanks to valid cache in memory logs which indicate that the extension is reusing some possibly old state.

@Tschipcraft
Copy link

Tschipcraft commented Nov 24, 2024

Yeah, I saw those in mine too. I had to restart VS Code for the extension to fully load after reinstalling. I could do it again and get the log right after if that's helpful
Edit: Even after not restarting, it still says Skipped thanks to valid cache in memory (https://mclo.gs/teRkPBg)
The files in the cache folder did get newly created though
Image

@Lunaticol
Copy link
Author

Same with above

@Plagiatus
Copy link

Plagiatus commented Dec 9, 2024

For me it depends on how I open the datapack. If I open it

a) directly or
b) through the folder directly above (e.g. the datapacks folder of a world)

the datapack(s) and spyglass load fine for me.

However, when I open the world folder with the datapacks folder inside of that, that's when I see this issue.

Edit to add: spyglass output.txt


For me all JSON files (advancements, recipes, item modifiers, loot tables, tags) are affected.

As for commands, it seems that only those that include NBT data (summon, data, execute store storage), item components (item replace) or JSON text (title, tellraw) are affected by this issue. (not macro lines)


Another issue that seems to come in tandem with this (as it's not there if the folder is loaded directly as described above), is that all my functions are unrecognized and thus a warning is shown: cannot find function foo:bar (rule: undeclaredSymbol). I assume this is considered a separate issue, but I noticed it seems to coincide with this issue.

@misode misode changed the title "Expected Nothing" Error when making tags (1.20.1) "Expected Nothing" in all JSON files and NBT tags Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants