- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 125
 
Open
Milestone
Description
Reported by VT01 on discord.
import { ZenStackMiddleware } from '@zenstackhq/server/express';Error:
SyntaxError: Named export 'ZenStackMiddleware' not found. The requested module '@zenstackhq/server/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 '@zenstackhq/server/express';
const { ZenStackMiddleware } = pkg;
Node.js v20.11.0
my tsconfig.json:
"compilerOptions": {
"target": "esnext",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"outDir": "./dist",
"noUncheckedIndexedAccess": true,
"lib": [
"ESNext"
],
}
package.json fields that probably causes the mistake (however I need it):
"type": "module"
tmax22 and medv
Metadata
Metadata
Assignees
Labels
No labels