tsedio / tsed

:triangular_ruler: Ts.ED is a Node.js and TypeScript framework on top of Express to write your application with TypeScript (or ES6). It provides a lot of decorators and guideline to make your code more readable and less error-prone. ⭐️ Star to support our work!
https://tsed.io/
MIT License
2.86k stars 284 forks source link

[BUG] Unexpected "export" statement in ES module "PlatformLogMiddlewareSettings.js" #2795

Closed Bugslive closed 2 months ago

Bugslive commented 2 months ago

Describe the bug

Failed to run application. Ouput: `> npm start ..... (node:69028) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension. [2024-08-26T15:55:17.887] [ERROR] [TSED] - /local_project/node_modules/@tsed/platform-log-middleware/lib/esm/index.js:4 export * from "./domain/PlatformLogMiddlewareSettings.js"; ^^^^^^

SyntaxError: Unexpected token 'export' at wrapSafe (node:internal/modules/cjs/loader:1383:18) at Module._compile (node:internal/modules/cjs/loader:1412:20) at Module._compile (/local_project/node_modules/source-map-support/source-map-support.js:568:25) at Module._extensions..js (node:internal/modules/cjs/loader:1551:10) at require.extensions..jsx.require.extensions..js (/private/var/folders/yv/gs10n_bd0q174_2v9_f3jjdw0000gn/T/ts-node-dev-hook-3104628146421098.js:114:20) at Object.nodeDevHook [as .js] (/local_project/node_modules/ts-node-dev/lib/hook.js:63:13) at Module.load (node:internal/modules/cjs/loader:1282:32) at Function.Module._load (node:internal/modules/cjs/loader:1098:12) at TracingChannel.traceSync (node:diagnostics_channel:315:14) at wrapModuleLoad (node:internal/modules/cjs/loader:215:24)`

To Reproduce

  1. Update Ts.ED to 7.80.X
  2. Run your application

Expected behavior

Application should start and be able to handle requests.

Code snippets

No response

Repository URL example

No response

OS

macOS

Node version

Node v22.4.1

Library version

v7.80.x

Additional context

No response

raphaelvserafim commented 2 months ago

I have the same error

Romakita commented 2 months ago

@Bugslive You have a project under commonjs ?

Romakita commented 2 months ago

Ok found issue. Something has changed on the build tooling and package.json with expected type isn't generated. I'll fix that.

github-actions[bot] commented 2 months ago

🎉 Are you happy?

If you appreciated the support, know that it is free and is carried out on personal time ;)

A support, even a little bit makes a difference for me and continues to bring you answers!

github opencollective

Romakita commented 2 months ago

:tada: This issue has been resolved in version 7.80.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

Romakita commented 2 months ago

@Bugslive it's fixed ;)

Bugslive commented 2 months ago

Thank you @Romakita. Have a good day