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

Unable to install or update in Foundry v11: Module validation errors due to missing packs[].type attribute in manifest? #172

Open
coffiarts opened this issue Jun 30, 2023 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@coffiarts
Copy link

coffiarts commented Jun 30, 2023

Describe the issue

Error: Unable to load valid module manifest data from "https://dragonflagon.cafe/mods/man/df-architect"
Module validation errors:
  packs: 
    0: 
      type: may not be undefined
    1: 
      type: may not be undefined
    2: 
      type: may not be undefined
    at Module.installPackage (file:///D:/FoundryVTT/Foundry%20Virtual%20Tabletop/resources/app/dist/packages/views.mjs:1:1692)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async SetupView.handlePost (file:///D:/FoundryVTT/Foundry%20Virtual%20Tabletop/resources/app/dist/server/views/setup.mjs:1:2076)

To Reproduce

  • Start Foundry v11 (with no DF architect installed)
  • Open Setup
  • Go to Add-on Modules
  • Click "Install"
  • Search for DF architect => which yields the latest version v4.0.0
  • Click "Install"

This produces the above error.

As a workaround, I've downloaded the latest zip and manually extracted it to my modules folder.
This seems to install the module, basically. As soon as I click the "update" button in Foundry setup, though, the same error occurs.

Expected behavior
Installing and updating running fine without such an error.

Screenshots (Optional)
Looks to my like some invalidity in module.json.
I guess that the problematic section is the packs declaration?
According to the error message, Foundry is expecting "type" nodes here, which seem to be missing:
image

@coffiarts coffiarts added the bug Something isn't working label Jun 30, 2023
@coffiarts coffiarts changed the title Unable to install or update: Module validation errors due to missing packs[].type attribute in manifest? Unable to install or update in Foundry v11: Module validation errors due to missing packs[].type attribute in manifest? Jun 30, 2023
@orcnog
Copy link

orcnog commented Jul 14, 2023

image

Still seeing this issue. Is this project being maintained?

@coffiarts
Copy link
Author

Still seeing this issue.

Yep, same for me. My workaround described above still works, though (download the latest zip and manually extract it to your modules folder): https://github.com/flamewave000/dragonflagon-arch/archive/refs/tags/df-architect_4.0.0.zip

Is this project being maintained?

I have the impression that it isn't.

So what can we do?
I tried a quick shot by forking this repo to see if I can find a fix myself, but to no avail so far. So far, I've experimented with hacking the json by manually adding the missing "type" node, but I guess that's not the point here. As long as the manually exploded mod works fine (even without the "type" node), it can't be technically invalid. And as long as I can't reproduce the error locally, any such "fixing" is just a blind guess.

We need someone with deeper understanding of the v11 module.json (which and I am definitely not).

@racehd
Copy link

racehd commented Jul 28, 2023

The module.json error is that entity needs to be type now. I did a simple replace-all here. I did verify with this change the module will be able to be enabled in V11. I haven't used this module before and have no idea about its functionality so if there's anything else not working then it's probably more than just the module.json.

	"packs": [
		{
			"name": "lights-dnd5e",
			"label": "Light Templates: D&D5e",
			"path": "packs/lights-dnd5e.db",
			"type": "Macro",
			"module": "df-architect"
		},
		{
			"name": "lights-pf1e",
			"label": "Light Templates: Pathfinder 1E",
			"path": "packs/lights-pf1e.db",
			"type": "Macro",
			"module": "df-architect"
		},
		{
			"name": "lights-pf2e",
			"label": "Light Templates: Pathfinder 2E",
			"path": "packs/lights-pf2e.db",
			"type": "Macro",
			"module": "df-architect"
		}
	],

@coffiarts
Copy link
Author

coffiarts commented Jul 28, 2023

The module.json error is that entity needs to be type now.

A good point! My error then was propably that I was trying to add the "missing" type node.
I'll try to reproduce your solution. If it works for me as well, I'll create a pull request.

@Dylenn187
Copy link

How cool! Thank you
The module loads now, but unfortunately my favorite function with the shift key and changing the light symbol to an X still does not work. Does anyone have a solution for this? I would be very happy!

@coffiarts
Copy link
Author

Well... it's clearly more complex then I'd hoped. Manually patching the module.json (as proposed by @redeux1) at least makes the mod be recognized again, so far, so good.

But beyond that, there are lots of loose ends. On loading a game world, the mod produces tons of hard errors and deprecation warnings.
Some features seem to work by chance (such as rendering light boundaries on the token layer), but others aren't.

The console errors/warnings suggest that the mods tries to overload lots of API functions, which may not be allowed anymore in V11.
In the worst case, this would mean that getting it to work in V11 needs an in-depth refactoring.

So I tried to look into the sources myself.

The project is too advanced-level for me, though, e.g. it uses Gulp for creating builds (of which I have near to no knowledge). I managed to run a halfway build, but the crucial part (building the sources and the module.json) fails with tons of API errors (see below).
Although I suppose it's mainly my lack of knowledge, it appears to me that those errors indicate the same thing as observed in the console in-game (see above). Looks like the mod tries to make use of outdated Foundry API:
image

In summary, I am lost. We need the author or a more experienced JS/TypeScript/Gulp developer here.

@Dylenn187
Copy link

Thank you for your work. Too bad that it is more complex than expected :( I hope someone finds a solution. Thanks anyway for all the effort

@coffiarts
Copy link
Author

coffiarts commented Jul 29, 2023

@Dylenn187 - You're welcome. And I'm still curious and haven't completely given up, still trying to delve into it a bit deeper. I am not a deeplyexperienced Foundry modder, so this is a lot of trial-and-error for me...
Still... one of the core issues might be that this mod relies heavily on foundry-vtt-types, and the lastest release of that seems to support Foundry v9 at the latest. That might explain a lot: https://github.com/League-of-Foundry-Developers/foundry-vtt-types/releases.
I understand that v11 has brought in its API some breaking changes for modules that are "wrapping" core classes of the Foundry API, in order to override or "enrich" core functionality. This mod here is a good example for such an "invasive" module, as it extends, for example, the mechanisms how scene views are rendered.
See this similar issue about AmbientLight: #171 (comment)
I am still exploring...

@DawidIzydor
Copy link

Having the same error when trying to update the module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants