Having trouble to get scripts loaded

Trying to make my first module and I have troubles getting anything loaded in Foundry. Here is what I have done so far: 1. Made the module using the Foundry admin UI view. 2. Added that module to one of my worlds. 3. Created a script to scripts/ folder of the module (I edit these files directly in the module folder). 4. Added the script to the module.json
{
"id": "test",
"title": "Test",
"version": "0.0.1",
"compatibility": {
"minimum": "11",
"verified": "11"
},
"scripts": [
"scripts/test.js"
],
}`
{
"id": "test",
"title": "Test",
"version": "0.0.1",
"compatibility": {
"minimum": "11",
"verified": "11"
},
"scripts": [
"scripts/test.js"
],
}`
However, whatever I add to the test.js file does not get loaded when I reload Foundry.
console.log("Hello World! This code runs immediately when the file is loaded.");

Hooks.on('init', () => {
console.log("init");
});

Hooks.on('ready', () => {
console.log("ready");
});
console.log("Hello World! This code runs immediately when the file is loaded.");

Hooks.on('init', () => {
console.log("init");
});

Hooks.on('ready', () => {
console.log("ready");
});
What could be the issue and how do I get started with module development?
Solution:
You dont want to log out, you want to shut off the world entirely.
Jump to solution
8 Replies
Vauxs
Vauxs10mo ago
Exit the world and go back into it. module.json does not get updated on refresh.
Nash
NashOP10mo ago
@Vauxs Thanks! Is that then the fastest way to do development? Do I always need to exit the world to test my changes?
Leo The League Lion
@Nash gave :vote: LeaguePoints™ to @Vauxs (#227 • 3)
Nash
NashOP10mo ago
Although it still does not seem to work. Even when logging out and back in, I do not see those console logs :(
Solution
Vauxs
Vauxs10mo ago
You dont want to log out, you want to shut off the world entirely.
Vauxs
Vauxs10mo ago
module.json is the only file that requires a full world reload, and you shouldn't have to modify it often.
Nash
NashOP10mo ago
Ah yes, now I got it. It works! Thanks!
Zhell🎄
Zhell🎄10mo ago
You have a comma in your manifest where you shouldn't.
Want results from more Discord servers?
Add your server