feathersjs / feathers

The API and real-time application framework
https://feathersjs.com
MIT License
14.97k stars 744 forks source link

Router object missing from `@feathersjs/express` #3320

Closed Complexlity closed 7 months ago

Complexlity commented 8 months ago

Steps to reproduce

Stackblitz Link showing a sample of the problem

Expected behavior

The Feathersjs Express Docs stated that the Router object is exposed from the @feathersjs/express package

image

Actual behavior

importing the Router object brings errors.

import express, { Router  } from '@feathersjs/express'
                  ^^^^^^
SyntaxError: Named export 'Router' not found. The requested module '@feathersjs/express' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using: 

import pkg from '@feathersjs/express';
const { Router  } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)        
    at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)

Node.js v18.17.1

Also, looking at the source code, it does not export the Router object

System configuration

Module versions (especially the part that's not working): "@feathersjs/express": "5.0.11", "@feathersjs/feathers": "5.0.11",

NodeJS version: Node.js v18.17.1

Operating System: Windows

Browser Version:

React Native Version:

Module Loader: