Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Javascript error in prod env #24

Closed
sgasser opened this issue Oct 8, 2017 · 6 comments
Closed

Javascript error in prod env #24

sgasser opened this issue Oct 8, 2017 · 6 comments

Comments

@sgasser
Copy link

sgasser commented Oct 8, 2017

Hi,

after

npm run prod

I get following javascript error on a clean installation:
Uncaught ReferenceError: webpackJsonp is not defined

@cretueusebiu
Copy link
Owner

For production you'll have to set the APP_ENV=production in your .env file.

@sgasser
Copy link
Author

sgasser commented Oct 8, 2017

I tried again but no luck...

This are the steps for the installation:

  • git clone git@github.com:cretueusebiu/laravel-vue-spa.git
  • cd laravel-vue-spa/
  • cp .env.example .env
  • update APP_ENV=production
  • composer install --no-dev
  • php artisan key:generate
  • php artisan jwt:secret
  • Edit .env and set your database connection details
  • php artisan migrate
  • yarn
  • npm run production
  • php artisan serve

But I get always this error:
selection_048

@cretueusebiu
Copy link
Owner

cretueusebiu commented Oct 8, 2017

What do you get if you dd(app()->environment()); ?

The Dusk tests run npm run production and work just fine.

@sgasser
Copy link
Author

sgasser commented Oct 8, 2017

Where should I write dd(app()->environment());

php artisan env returns
Current application environment: production

npm run production returns no error.

I get the error Uncaught ReferenceError: webpackJsonp is not defined when I open http://127.0.0.1:8000

@cretueusebiu
Copy link
Owner

Try using a domain for your app with Valet or Homestead.

@wa05
Copy link

wa05 commented Dec 16, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants