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

Your project is unusable #347

Open
CharlesOnAir opened this issue Jun 7, 2023 · 4 comments
Open

Your project is unusable #347

CharlesOnAir opened this issue Jun 7, 2023 · 4 comments

Comments

@CharlesOnAir
Copy link

Capture d'écran 2023-06-07 101850

@joaocasarin
Copy link

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.

@Pridestalkerr
Copy link

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.

@paras-verma
Copy link

paras-verma commented Jul 26, 2023

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)

@Falven
Copy link

Falven commented Oct 6, 2023

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',
        },
      ],
    }),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants