Giter VIP home page Giter VIP logo

vue-airbnb-ssr's Introduction

Hi there 👋

vue-airbnb-ssr's People

Contributors

zeng95 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

sml782

vue-airbnb-ssr's Issues

npm run dev运行时候报错,请问这种情况该怎么办,谷歌搜索也没解决

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Not working for prod

hey, really cool project, it really helped me. However, I have a problem in prod. if I build the project with build:ssr and start it on a server with prod:ssr, then the axios requests no longer work with the proxy.

The requests are displayed in the network tab but the response is simply the index.html:
image

Could it be because I don't use a router? I have removed everything that has to do with routers. However, everything works locally with dev:ssr.

My package.json scripts:

"dev:ssr": "cross-env NODE_ENV=development npx node-dev server",
"prod:ssr": "cross-env NODE_ENV=production npx node-dev server",
"build:ssr": "npm run build:client && npm run build:server",
"build:client": "vite build --ssrManifest --outDir dist/client",
"build:server": "vite build --ssr src/entry-server.js --outDir dist/server",

My vite.config.ts:

import {fileURLToPath, URL} from 'url'

import {defineConfig, loadEnv} from 'vite'
import vue from '@vitejs/plugin-vue'

export default defineConfig(({ command, mode }) => {
    const env = loadEnv(mode, process.cwd())

    return {
        plugins: [vue()],
        resolve: {
            alias: {
                '@': fileURLToPath(new URL('./src', import.meta.url))
            }
        },
        server: {
            proxy: {
                "/api": {
                    target: `https://${env.VITE_DASHBOARD_SUB}.${env.VITE_DOMAIN}`,
                    changeOrigin: true
                },
                "/tebex": {
                    target: "https://plugin.tebex.io",
                    changeOrigin: true,
                    rewrite: (path) => path.replace(/^\/tebex/, ""),
                    headers: {
                        'X-Tebex-Secret': env.VITE_TEBEX_SECRET
                    }
                }
            }
        },
        css: {
            preprocessorOptions: {
                scss: {
                    quietDeps: true,
                    additionalData: `
                    @use 'aos/dist/aos.css';
                    @use 'sweetalert2/src/sweetalert2.scss';
                    @use '@/assets/scss/sweetalert.scss';
                    @use '@/assets/scss/fonts.scss';
                    @use '@/assets/scss/slides/slides.scss';
                `
                }
            }
        }
    }
})

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.