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

npm run build result not working production #11

Closed
jeremenichelli opened this issue Jun 11, 2016 · 10 comments
Closed

npm run build result not working production #11

jeremenichelli opened this issue Jun 11, 2016 · 10 comments

Comments

@jeremenichelli
Copy link

jeremenichelli commented Jun 11, 2016

I didn't want to rise an issue on this because it could be a local problem and it would be a shame to bother maintainers with this, but couldn't find any similar problem in forums.

I've used this template which worked great locally - kudos for that - but after building and including the dist folder in a repository the router never starts the app and there's no console error either.

Here's the link https://jeremenichelli.github.io/movies/results/vue

Any shed of light is appreciated since I'm planning to write about various frameworks including Vue 😃

@chrisvfritz
Copy link
Contributor

You don't have vue-router installed, so it shouldn't work in development or production right now. npm install --save vue-router, npm run build, then correct the link to results (with an s) and you'll be good. 😃

In the future though, since the problem is specific to your code and does not affect a freshly generated project using this template, either the forum or the Gitter chat would be a better place for questions like this.

@jeremenichelli
Copy link
Author

Thanks for checking that @chrisvfritz, I did install it but somehow didn't got to the dependencies inside the package.json file. It's weird the fact that it works on my computer, it still doesn't on the gh-pages address. and I checked the build.js file and it's there. I will move this to the forum. Thank you.

@chrisvfritz
Copy link
Contributor

It doesn't look like you've rerun npm run build and commited the new dist after adding vue-router to dependencies. After that, you may also need to do a hard refresh as this template doesn't add asset hashes like the more complex Webpack template.

@jeremenichelli
Copy link
Author

jeremenichelli commented Jun 13, 2016

I did rerun build. Any idea on how to do that hard refresh? It seems like build is throwing the same result, to be sincere I don't really understand what's the exact problem 😢

@jeremenichelli
Copy link
Author

jeremenichelli commented Jun 13, 2016

I mean, what is that I should manually do to actually reflect that change? In case you're talking about caché and browser hard refresh, I can asure you that's not the problem.

@chrisvfritz
Copy link
Contributor

chrisvfritz commented Jun 13, 2016

There isn't anything more that should need to be done to reflect a change. I unfortunately don't have time to take a deep dive into why your application might not be working, but I can leave you with this last thing I noticed at a quick glance.

The activate and deactivate hooks on your search page should theoretically never resolve, since they take a transition argument and one needs to call transition.next() to resolve. See the vue-router docs for more. Hope this helps and that you're able to get your app working! 😃

@jeremenichelli
Copy link
Author

It's ok @chrisvfritz, didn't expect anyone to waste their time with this specific debugging, it wouldn't feel right. I thank you for taking some of your time to take a quick look at it.

Since it's not throwing an error, my assumption is that the root view is not showing because of the path on the location of my GitHub page and it explains why locally it works on both dev and production mode.. The final test would be to put that solution in a server and see what happens.

Thanks again!

@recioRaszak
Copy link

Hey guys! Had exactly the same issue...

[solved] Router's working in dev but not in prod, because routes change their root...
Remember to remap your routes with /path-to/production or a relative path (don't know yet how, I've used absolute routes for my pre-prod test and it WORKED)

@schatekar
Copy link

@recioRaszak what do you mean by remap your routes with /path-to/production or a relative path? Can you explain with an example?

@recioRaszak
Copy link

@schatekar Hum... Some months had passed, I don't remember very well the thread... but the thing is, in the configuration file or router configuration, do not use "/" or "/app", <- relative paths. I was trying to say to use absolute paths "http://domain.com/sub-section-or-not/app/"...

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

4 participants