1

I've been developing my Laravel app for some time now and decided to merge everything into Spark. I quickly realized my limited PHP/JS background was not really compatible with Spark so I tried to touch the Spark code as little as possible in order to keep things working and just use the goodies of Spark (stripe integration, user notifications etc etc.

Anyway, I think I broke it. I can open my page but can't get the drop down user menu. Chrome informs me about the following error:

Uncaught ReferenceError: Spark is not defined 
at Object.module.exports.el (app.js:24333) 
 at webpack_require (app.js:20) 
at Object. (app.js:18567) 
at webpack_require (app.js:20) 
at Object. (app.js:51833) 
at webpack_require (app.js:20) 
at app.js:66 at app.js:69

I am using a Ubuntu installation that I build using vagrant, everything seemed to work fine. Since I wanted to update to Laravel 5.5 anyway, I decided to checkout a new Spark project and integrate all my code. After some hurdles I got it to work, but again, the same error. It's probably something very trivial, so I apologize in advance ....

For sake of completedness, if I checkout a vanilla spark test app I can register and everything works perfect.

And after copying the relevant files, modifying composer.json (and running composer update etc). I get the same error again....

Anyone??

helloworld
  • 223
  • 1
  • 7
  • 24
  • Hi, I am having a similar problem, has you been able to figure out what is that error about? – Luis Mata B. Sep 24 '18 at 19:34
  • Sorry.... i tried to remember but I didn't write it down. I did figure it out eventually, probably took a vanilla Spark and go from there... – helloworld Sep 25 '18 at 16:17

1 Answers1

3

Make sure you include

<script>
    window.Spark = @json(array_merge(Spark::scriptVariables(), []));
</script>

In your <head></head>

Zac Grierson
  • 656
  • 1
  • 6
  • 21