Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ulrichm's avatar

Uncaught TypeError: Cannot read property 'price' of null

Hi, after installing Spark 2.0, I try to register and I get this error Uncaught TypeError: Cannot read property 'price' of null in app.js :

if (!Spark.cardUpFront || this.selectedPlan.price == 0) { return this.sendRegistration(); }

My booted() in SparkServiceProvider looks like this:

public function booted() { Spark::useStripe()->noCardUpFront()->trialDays(9999); Spark::freePlan() ->price(0) ->features([ 'First', 'Second', 'Third' ]); }

0 likes
6 replies
ahuggins's avatar

looks like you don't have a selectedPlan in this part of the code

if (!Spark.cardUpFront || this.selectedPlan.price == 0) { return this.sendRegistration(); }
ahuggins's avatar

post the code around that for additional context

ulrichm's avatar

The script is not anything I have touched, it is a part of Spark, and the problem does not occur in spark 1.0, where I have exactly the same booted method. Maybee it´s a Vue.js problem, since the javascript code is a part of a Vue.Component / module

ulrichm's avatar

Updated NPM and nodejs: Did not fix it

mattyglover's avatar

Did you ever find a solution for this? I have an old project and now can't register users.

Please or to participate in this conversation.