My vue.app is not showing up on the deployed version, what could be causing this issue?

I'm currently facing an issue while trying to deploy my vue.js project on Github Pages. While HTML, CSS, and images are rendering perfectly, the Vue app components seem to be disappearing. It seems like the part responsible for rendering the Vue app is not working. Here is a visual representation of my directory structure: ›https://i.sstatic.net/nSD4A.png

You can also find my git repository at: https://github.com/liulian1004/test.

I would greatly appreciate any help or guidance as I am relatively new to Vue.js and this is my first attempt at deploying a Vue project. Feel free to reach out if you need more information. Thank you!

Answer №1

Because the app is not being served from the root directory, but rather from /test, you must set up the publicPath in the vue.config.js file:

module.exports = {
   publicPath: '/test/'
}

Here is an alternative approach to setting a conditional publicPath using the .env file, as outlined in the Vue CLI documentation. This method ensures proper serving of the app in both development and production environments:

module.exports = {
  publicPath: process.env.NODE_ENV === 'production'
    ? '/test/'
    : '/'
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to utilize regex in converting this CSS block to LESS?

Currently undertaking the task of refining over 10,000 lines of CSS code. Instead of manually converting line by line, I aim to transform from this: -webkit-transition: .1s linear all; -moz-transition: .1s linear all; transition: .1s linear all ...

Combine two groups of elements

I have attempted to combine 2 objects of objects using both the spread operator and Object.assign methods. However, I am only seeing the results from the second object in my final output. let obj1= { ratings: [], stats: {restaurants: 0, bnb: 0, ...

Searching for boolean values in MongoDB: True, false, or both?

I'm currently in the process of developing an MVEN project for a client, and as someone who primarily specializes in FrontEnd development, I am just starting to familiarize myself with MongoDB. This has led me to encounter a basic question. Within my ...

Is there a way to determine if a div is positioned 100px from the bottom edge?

When using the sticky class to stick a div, I encountered an issue where it sticks correctly from the top but overlaps the footer at the bottom. https://i.sstatic.net/28A3A.jpg Here is the HTML code: <div class="tab-content"> <div role="tab ...

Splitting code is not being done through React's lazy import and the use of Webpack

//webpack development configuration const common = require("./webpack.common"); const merge = require("webpack-merge"); const globImporter = require('node-sass-glob-importer'); module.exports = merge(common, { mode: "development", modul ...

Executing Client-Side Function Upon Data Retrieval in a Node.js Application

Within my node.js Express application, there exists a route like this: router.get('/devices/:id/visualize', catchErrors(deviceController.visualizeDevice)); This route points to the following controller: exports.visualizeDevice = async (req, re ...

Issue with ThreeJs: Difficulty loading separate images on top and bottom surfaces

I've been trying to place different textures on the top and bottom sides using Threejs to display unique images on each side. However, I'm encountering an issue where the same image is being displayed on both the top and bottom sides. Below is th ...

Looking to achieve a scroll effect with mix-blend-mode using JavaScript?

I am seeking a method to adjust the background color of a specific element based on the background itself. While CSS offers the mix-blend-mode property, I am looking to specify the color manually. Ideally, I would like to achieve the same effect using an ...

Configuring Three JS Orbit Controls

I am facing an issue with OrbitControls while rendering a 3D wireframe model of a building using threeJS. The problem lies in the camera position. To resolve this, I need to customize the controls as follows: Pan will be controlled by the middle mouse bu ...

Access to property 'CKEDITOR' is unauthorized

After successfully integrating CKEditor and CKFinder on multiple sites, I encountered an issue with one particular site. Upon inspecting the Firebug console, I noticed the following error message: Error: Permission denied to access property 'CKEDITOR ...

Numerous applications collaborating on workflows within a Firebase project

I am planning to create multiple Progressive Web App (PWA) sites under a single Firebase project. The idea is to make them accessible through different subdomains like app1.domain.com, app2.domain.com, and app3.domain.com. Even though these apps are conce ...

The execution of 'observe' on 'MutationObserver' failed because parameter 1 is not the correct type of 'Node'. Ensure to use select2() instead

Attempting to implement select2 for dynamically loaded data via ajax, I am encountering the error mentioned above. What could be the issue? Below is the code snippet in question: $(document).on('change', '[name="country"]', fu ...

Error: The function nodemailer.createTransport is not defined or does not exist

I'm currently working on integrating nodemailer into my nodejs application for sending emails. Check out the code below: var express = require('express'); var nodemailer = require('node-mailer'); var app = express(); app.post(&a ...

Invoke a method on a ReactJS component class instance

Currently, I am working with a ReactJs class called Linker: var Linker = React.createClass({ foo: function(){ console.log('foo') }, render: function(){ return ( <div></div> ); } }); I am facing an issue wh ...

How can you leverage jQuery's .load() method to preload an image without passing any arguments?

While going through a jQuery plugin, I stumbled upon this code that claims to preload the next image in a lightbox: if( options.preloadNext ) { var nextTarget = targets.eq( targets.index( target ) + 1 ); if( !nextTarget.length ) nextTarget = targe ...

What is the best way to structure Sequelize associations?

Currently, I am tackling the challenge of nesting associations through Node.js/Sequelize with PostgreSQL. While it's a common scenario in database management, finding the right approach has proven to be quite elusive for me thus far. Let me break down ...

Is there a way to transform a string property into a custom type in a TypeScript array?

I am faced with a situation where I have an interface that is extending a MongoDB document, along with some sample data that is also extending that interface. Below is an outline of the interface: export default interface IModel extends Document { _id: Obj ...

What is the reason behind the code breaking when a newline is added between `return` and `(`?

After investigating my query, it seems that a peculiar issue arises in the code where setState fires and render method gets hit, but nothing rerenders The code functions correctly when there is no newline between the return statement and opening parenthes ...

Load images and audio files using jQuery AJAX prior to the page being rendered

Recently, I embarked on a new project - a web app that incorporates numerous images and mp3 sounds. However, I encountered an issue where new images and sounds would load over time as users explored different parts of the app. To address this problem, I de ...

Using PHP/JavaScript to activate a button once the timer reaches 00:00

I came across a JavaScript fiddle code that is working perfectly. Here it is: HTML <div id="worked">00:05</div> JS $(document).ready(function (e) { var $worked = $("#worked"); function update() { var myTime = $worked.h ...