Hey everyone!
I have tried to work this out on my own for a couple of days now and I’m both out of my depth and out of ideas.
When I go to my page it injects the portal.min.js in the {{ghost_head}}, ala:
<script defer src="https://cdn.jsdelivr.net/ghost/portal@~2.51/umd/portal.min.js" data-i18n="true" data-ghost="https://etcvfx.com/" data-key="____________" data-api="https://_____.com/ghost/ghost/api/content/" data-locale="en" crossorigin="anonymous"></script>
But the buttons to go to Sign Up, Sign In, Subscribe, Open Portal, etc; all do nothing.
<a href="[#/portal/signup](https://etcvfx.com/#/portal/signup)">Try Sign Up</a>
<a href="[#/portal/signin](https://etcvfx.com/#/portal/signin)">Try Sign In</a>
<a href="[#/portal/](https://etcvfx.com/#/portal/)">Open Portal</a>
<button data-portal="signup">Subscribe</button>
The browsers devtools console relays an error:
App.js:242 [Portal] Failed to initialize: TypeError: Cannot read properties of undefined (reading 'replace')
at Xu (helpers.js:731:25)
at h0.setupFirstPromoter (App.js:641:26)
at h0.fetchApiData (App.js:596:18)
at async h0.fetchData (App.js:253:45)
at async h0.initSetup (App.js:195:103)
initSetup @ App.js:242
In the console I do some fetch() tests…
fetch("https://######.com/ghost/api/content/settings/?key=##########################")
Promise {<pending>}[[Prototype]]: Promise[[PromiseState]]: "fulfilled"[[PromiseResult]]: Response
fetch("https://######.com/ghost/api/content/settings/?key=##########################")
.then(r => r.json())
.then(data => console.log(data.settings.firstpromoter_account));
Promise {<pending>}[[Prototype]]: Promise[[PromiseState]]: "fulfilled"[[PromiseResult]]: undefined
The issue does seem to revolve around this FirstPromoter business. But I’m not using that integration and don’t plan to. I have tried to update the mysql ghostdb settings table so firstpromoter_account to NULL, “”, ‘’, and “none”. But the portal.min.js continues to report undefined.
I have tried rolling my own portal.min.js and tweaking the Xu/xu elements, but they continue to fail. I don’t think I can disable the {{ghost_head}} or {{ghost_foot}} without encountering other issues. I’m really just stuck?
So, here’s the ask… I want to use Ghosts native memberships/comment system. I have the memberships set to “anyone can join”. But I can’t get the portal to work and I’m out of ideas to fix it. Can anybody help me out?