lowcrawler
lowcrawler

Reputation: 7599

net::ERR_HTTP2_PROTOCOL_ERROR 200 (OK) with Vite React App

I build my React app using Vite. This is my Vite config:

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import commonjs from 'vite-plugin-commonjs';
import { APP_URL_BASENAME } from './src/constants/Config';

export default defineConfig(() => {

  return {
    plugins: [react(), commonjs()],
    base: APP_URL_BASENAME ?  APP_URL_BASENAME : '/blahblah/',
    define: {
      'process.env': process.env, 
    },
  };
});

When I run my build I get my dist folder.

When I copy this to my host, I get a message saying:

GET https://dev-apps.yada.com/project/assets/index-ASXLc9JY.js
net::ERR_HTTP2_PROTOCOL_ERROR 200 (OK)

The network tab seems to indicate that I'm loading the index.html file, which in turn tries to load the index-ASXLc9JY.js file, and the load of that asset is giving me that error.

The strange part is:

  1. That file exists;
  2. That file is accessible; and
  3. if I go directly to that file it loads, and then I can go back to the app and it loads completely fine.

Upvotes: 0

Views: 19

Answers (0)

Related Questions