Giter Site home page Giter Site logo

Comments (4)

joaocasarin avatar joaocasarin commented on July 27, 2024 2

up, I face the same error.

in my case it works while i am still coding with typescript, but after i transpile the code to javascript to a folder dist/, the swagger simply doesn't work anymore.

from swagger-ui-express.

paras-verma avatar paras-verma commented on July 27, 2024 2

this package uses swagger-ui-dist which contains the static UI assets (CSS & JS)

it serves those assets directly from inside the node_modules using the method getAbsoluteFSPath exported by swagger-ui-dist

so you may face issues during bundling as these assets aren't explicitly imported, hence the 404 issues (@joaocasarin)

from swagger-ui-express.

Pridestalkerr avatar Pridestalkerr commented on July 27, 2024

Same here. It works when I bundle my project with tsup, but fails with esbuild. Can probably provide some more information if needed to debug this. I believe it's probably an issue with the bundler and not the library itself.

from swagger-ui-express.

Falven avatar Falven commented on July 27, 2024

pnpm install -D swagger-ui-dist

import { copy } from 'esbuild-plugin-copy';

copy({
      assets: [
        {
          from: ['./node_modules/swagger-ui-dist/swagger-ui-bundle.js'],
          to: 'SwaggerUIBundle.js',
        },
        {
          from: ['./node_modules/swagger-ui-dist/swagger-ui-standalone-preset.js'],
          to: 'SwaggerUIStandalonePreset.js',
        },
      ],
    }),

from swagger-ui-express.

Related Issues (20)

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.