chimurai / http-proxy-middleware

:zap: The one-liner node.js http-proxy middleware for connect, express, next.js and more
MIT License
10.79k stars 852 forks source link

Circular dependency of build #1007

Closed Juansasa closed 5 months ago

Juansasa commented 5 months ago

Checks

Describe the bug (be clear and concise)

Got this error while compiling with Rollup

node_modules/http-proxy-middleware/dist/index.js -> node_modules/http-proxy-middleware/dist/legacy/index.js -> node_modules/http-proxy-middleware/dist/legacy/public.js -> node_modules/http-proxy-middleware/dist/legacy/create-proxy-middleware.js -> node_modules/http-proxy-middleware/dist/index.js

Step-by-step reproduction instructions

Build with rollup + typescript

Expected behavior (be clear and concise)

More consistent dist import termination

How is http-proxy-middleware used in your project?

express proxy middleware

What http-proxy-middleware configuration are you using?

server.use(
  createProxyMiddleware({
    pathFilter: "/api",
    changeOrigin: true,
    secure: false,
    target: process.env.API,
    pathRewrite: {
      "^/api/": "/internal/endpoint/",
    },
    logger: console,
  }),
);

What OS/version and node/version are you seeing the problem?

Mac OSX 14.4.1
Node v21.7.2

Additional context (optional)

No response

chimurai commented 5 months ago

Thanks for reporting @Juansasa

Am able to confirm the circular dependencies:

npx madge --circular src/index.ts
image