nuxt-proxy icon indicating copy to clipboard operation
nuxt-proxy copied to clipboard

Module '"nuxt-proxy/middleware"' has no exported member 'createProxyMiddleware'

Open jonkri opened this issue 1 year ago • 0 comments

Hi! 👋

I'm getting a TypeScript error when importing { createProxyMiddleware } from 'nuxt-proxy/middleware':

$ npx nuxi@latest init nuxt-proxy-import
$ cd nuxt-proxy-import
$ npm install
$ npm install nuxt-proxy
$ mkdir -p server/middleware
$ echo "import { createProxyMiddleware } from 'nuxt-proxy/middleware'" > server/middleware/proxy.ts
$ tsc --noEmit server/middleware/proxy.ts 
node_modules/nuxt-proxy/middleware.d.ts:1:15 - error TS2307: Cannot find module './dist/runtime/middleware' or its corresponding type declarations.

1 export * from './dist/runtime/middleware'
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~

server/middleware/proxy.ts:1:10 - error TS2305: Module '"nuxt-proxy/middleware"' has no exported member 'createProxyMiddleware'.

1 import { createProxyMiddleware } from 'nuxt-proxy/middleware'
           ~~~~~~~~~~~~~~~~~~~~~


Found 2 errors in 2 files.

Errors  Files
     1  node_modules/nuxt-proxy/middleware.d.ts:1
     1  server/middleware/proxy.ts:1

Thanks for making this plugin!

jonkri avatar May 08 '23 09:05 jonkri