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

dev server can't run with url endsWith file extensions #5265

Closed
7 tasks done
4-1-1 opened this issue Oct 12, 2021 · 3 comments
Closed
7 tasks done

dev server can't run with url endsWith file extensions #5265

4-1-1 opened this issue Oct 12, 2021 · 3 comments
Labels
duplicate This issue or pull request already exists pending triage

Comments

@4-1-1
Copy link

4-1-1 commented Oct 12, 2021

Describe the bug

Runs ok with normal url
image
Runs ok with filename url
image
and broken, when click refresh button.
image

Reproduction

Every thing is ok in production .
Hard to Reproduction in online.

export default defineConfig(({command}) => {
    return {
    resolve: {
        alias: {
            '@ezone': path.resolve(__dirname, 'node_modules/@ezone'),
            '@': path.resolve(__dirname, 'src'),
            '~@': path.resolve(__dirname, 'src'),
            ...(command === 'serve' ? npmLinkPaths : {}),
        },
    },
    envPrefix: 'REACT_APP',
    esBuild: {
        exclude: ['node_modules'],
        jsxInject: 'import React from \'react\'',
    },
    build: {
        outDir: 'build',
        assetsDir: 'static',
        sourcemap: false,
        rollupOptions: {
            output: {
                manualChunks(id) {
                    if (id.includes('monaco')) {
                        return 'editor';
                    }
                    if (id.includes('prose') || id.includes('markdown')) {
                        return 'markdownEditor';
                    }
                    if (id.includes('aliIcon')) {
                        return 'aliIcon';
                    }
                },
            },
        },
    },
    css: {
        preprocessorOptions: {
            less: {
                modifyVars,
                javascriptEnabled: true,
            },
        },
    },
    optimizeDeps: {
        include: ['lodash'],
    },
    plugins: allPlugins,
    server: {
        https: process.env.REACT_APP_HTTPS,
        watch: {
            followSymlinks: true,
        },
        proxy: {
            '/v1': {
                target: apiProxy,
                logLevel: 'debug',
                changeOrigin: true,
            },
            '/socket.io': {target: wsProxy, ws: true, changeOrigin: true},
        },
    },
};
});

System Info

System:
    OS: macOS 10.15.7
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
    Memory: 640.63 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 14.17.6 - /usr/local/bin/node
    Yarn: 1.17.0 - /usr/local/bin/yarn
    npm: 6.14.15 - /usr/local/bin/npm
  Browsers:
    Chrome: 94.0.4606.71
    Firefox: 92.0
    Safari: 14.0.3
  npmPackages:
    @vitejs/plugin-react-refresh: ^1.3.6 => 1.3.6 
    vite: ^2.5.6 => 2.5.10

Used Package Manager

npm

Logs

No response

Validations

@pretender91
Copy link

dots in url breaks dev server. Had same problem

gauntiantian pushed a commit to gauntiantian/vite that referenced this issue Dec 18, 2021
@vovchisko
Copy link

In addition:

  • localhost:8080/some.route.dots browser returns 404.
  • localhost:8080/some.route.dots/settings works.

@sapphi-red
Copy link
Member

sapphi-red commented Apr 17, 2022

duplicate of #2415

@sapphi-red sapphi-red reopened this Apr 17, 2022
@sapphi-red sapphi-red added the duplicate This issue or pull request already exists label Apr 17, 2022
@github-actions github-actions bot locked and limited conversation to collaborators May 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists pending triage
Projects
None yet
Development

No branches or pull requests

4 participants