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

Admin tries to load assets from localhost after running twill-dev #152

Closed
zipavlin opened this issue Jan 15, 2019 · 6 comments
Closed

Admin tries to load assets from localhost after running twill-dev #152

zipavlin opened this issue Jan 15, 2019 · 6 comments
Labels
type: bug Something isn't working type: enhancement New feature or request

Comments

@zipavlin
Copy link
Contributor

Admin assets try to load from localhost:8080 after running npm run twill-dev:

http://localhost:8080//assets/admin/css/app.css
http://localhost:8080//assets/admin/js/manifest.js
http://localhost:8080//assets/admin/js/vendor.js
http://localhost:8080//assets/admin/js/main-form.js

This of course works as expected when twill-dev command is running, but assets should probably be requested from <domain>/assets/admin/* when we are no longer watching for changes - this results in assets not being found and admin being not-really-useful.

Running npm run twill-build doesn't change this.

I have no idea, what is causing this. I am on Win 10, running Laravel app from homestead.
Any help is appreciated! :)

@m4n1ok
Copy link
Member

m4n1ok commented Jan 15, 2019

Hi @zipavlin,

Did you try to remove hot file in public directory ? #49 (comment)

Hope that helps.

@ifox
Copy link
Member

ifox commented Jan 15, 2019

Hi @zipavlin,

thanks @m4n1ok! I wish Mix would automatically delete the hot file when stopping the HMR server but I guess a solution would be to add rm -f public/hot to the start of the twill-build script.

@ifox ifox added type: bug Something isn't working type: enhancement New feature or request labels Jan 15, 2019
@zipavlin
Copy link
Contributor Author

Thank you @m4n1ok and @ifox.
Deleting public/hot and running npm run twill-build worked!

@raymondtri
Copy link
Contributor

I had a similar issue with this where I was getting an invalid host/origin error while reloading hot.

npm run twill-dev still didn't work for me and it took quite some time to figure out.

The fix was modifying the actual vendor/area17/twill/package.json to include the configuration option "--disable-host-check" within the hot script. The security vulnerability shouldn't be important because you wouldn't be using a hot reload script in a production environment. The reason I had to modify the twill package.json is because that seemed to be what is being run concurrently in the twill-dev script.

@ifox
Copy link
Member

ifox commented Apr 2, 2019

Hey @raymondtri, I went through the same issue a couple of days ago and came up with the exact same conclusion, this is perfectly fine for local development. We should be able to release 1.2.2 this week with that fix included.

Reference: laravel-mix/laravel-mix#1955

@raymondtri
Copy link
Contributor

raymondtri commented Apr 3, 2019

Awesome!

Edit: I was going down a rabbit hole and after a good night's sleep realized it was actually crazy simple to use custom vue components in addition to those created by twill.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants