0

I can't find a solution to this problem. In laravel 5.2 all I needed was to install the npm package and then in app.js add this line:

window.EXIF = require('exif-js');

now in laravel 5.5 there's this new bootstrap.js file where you are supposed to put the same line. However doing so results in error:

Uncaught ReferenceError: EXIF is not defined

I tried to mix the exif.js directly and load it in the page I am using and also set a VAR EXIF = require('exif-js'); in the script but then I get the error: Uncaught ReferenceError: base64ToArrayBuffer is not defined

I am out of ideas. Nothing works.

Chriz74
  • 1,410
  • 3
  • 23
  • 47
  • Just trying to undestand what you're doing. So you have `window.EXIF = require('exif-js');` in ./resources/assets/js/bootstrap.js . right? that means you've installed laravel mix and you're using it, so what do you have in the webpack.mix.js file (which is in the project root folder) – Sérgio Reis Jan 18 '18 at 18:39
  • I am mixing app.js there (which as far as I understand should get the exif.js and publish it in public/app.js) – Chriz74 Jan 18 '18 at 18:46
  • And your app.js has this `require('./bootstrap');` ? – Sérgio Reis Jan 18 '18 at 18:46
  • Exactly, it has that line. – Chriz74 Jan 18 '18 at 18:47
  • If you open your browser console and type `EXIF` does it output anything or 'undefined' ? – Sérgio Reis Jan 18 '18 at 18:48
  • `Uncaught ReferenceError: EXIF is not defined` – Chriz74 Jan 18 '18 at 18:50
  • are you doing `npm run dev` everytime or have a `npm run watch` on? – Sérgio Reis Jan 18 '18 at 18:52
  • i'm using `npm run dev`. What I underdstand is that that `window.EXIF` line in bootstrap.js should instruct the framework that EXIF is needed globally. In 5.2 I didn't include app.js in my views and exif worked nonetheless. – Chriz74 Jan 18 '18 at 18:54
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/163435/discussion-between-sergio-reis-and-chriz74). – Sérgio Reis Jan 18 '18 at 18:55

0 Answers0