Profile Service error

So i started making a new game and i wanted to save my data using ProfileService. I’ve followed a tutorial by Amora. After trying to test it for the first time i got this error :

ServerScriptService.Modules.ProfileService:2209: [ProfileService]: Missing or invalid "Name" parameter  - 

I don’t know how to fix this. I’m pretty sure it is a problem with my DataManager script, but it also could be my Template being setup wrong as i don’t really know that much about tables yet.

My template :

local Template = {
	["Fist Strenght"] = 0;
	["Endurance"] = 0;
	["Psychic Power"] = 0;
	["Movement Speed"] = 0;
	["Jump Force"] = 0;
	
	Currencies = {
		["Tokens"] = 0;
		["Runes"] = 0;
	};
	
	Multipliers = {
		["Fist Strenght"] = 1;
		["Endurance"] = 1;
		["Psychic Power"] = 1;
		["Movement Speed"] = 1;
		["Jump Force"] = 1;
		["Tokens"] = 1;
		["Runes"] = 1;
	}
	
}

return Template

And here is my DataManager script :

local Players = game:GetService("Players")
local ServerScriptService = game:GetService("ServerScriptService")
local RunService = game:GetService("RunService")
local modules = ServerScriptService.Modules

local ProfileService = require(modules.ProfileService)
local Template = require(script.Template)

local DATA_KEY = "_Production_0"
if RunService:IsStudio() then
	DATA_KEY = "_Datastore_Testing_0"
end
local profileStore = ProfileService:GetProfileStore(DATA_KEY, Template)

local DataManager = {}
DataManager.Profiles = {}

local function playerAdded(player: Player)
	local profile = profileStore:LoadProfileAsync("Player_"..player.UserId)
	
	if profile ~= nil then
		profile:AddUserId(player.UserId)
		profile:Reconcile()
		
		profile:ListenToRelease(function()
			DataManager.Profiles[player] = nil
			player:Kick("Profile was released")
		end)
		
		if player:IsDescendantOf(Players) then 
			DataManager.Profiles[player] = profile
		else
			profile:Release()
		end
	else
		player:Kick()
	end
end

local function playerRemoving(player: Player)
	local profile = DataManager.Profiles[player]
	
	if profile ~= nil then
		profile:Release()
	end
end

for _,player in Players:GetPlayers() do
	task.spawn(playerAdded, player)
end

Players.PlayerAdded:Connect(playerAdded)
Players.PlayerRemoving:Connect(playerRemoving)

return DataManager

Any help will be appreciated! Also i hope it’s not something dumb.

Everything looks correct to me. The only I would change is your template to this but it’s up too you.

return {
	["Fist Strenght"] = 0;
	["Endurance"] = 0;
	["Psychic Power"] = 0;
	["Movement Speed"] = 0;
	["Jump Force"] = 0;
	
	Currencies = {
		["Tokens"] = 0;
		["Runes"] = 0;
	};
	
	Multipliers = {
		["Fist Strenght"] = 1;
		["Endurance"] = 1;
		["Psychic Power"] = 1;
		["Movement Speed"] = 1;
		["Jump Force"] = 1;
		["Tokens"] = 1;
		["Runes"] = 1;
	}
}

Try following this dudes tutorial, he goes in great detail and he put the finished script in the comment section so you can just put it in studio. Taking his script and then just changing the template saves you probably an hour of your life. Make sure you understand how he uses the DataManager Module tho. I find his way more simpler than what you are trying to achieve in your DataManager.

Hello, I reproduced your problem and found a solution.

:GetProfileStore(DATA_KEY, Template) should be .GetProfileStore(DATA_KEY, Template)
It’s not a method, it’s a function. if you use the method then you need to add metatable but ProfileStore added it as a self parameter in methods. so Its argument is a table that misunderstands type-checking. The correct thing to do is to remove :GetProfileStore and replace with .GetProfileStore

Thank you for the effort you put in this! It works fine now. I knew it was something dumb that i just couldnt see.