brillout / vite-plugin-server-entry

Handles the server production entry.
8 stars 2 forks source link

Bug with version 0.5.2 #14

Closed buituansonHE172207 closed 3 days ago

buituansonHE172207 commented 3 days ago

Bug Report: Issue with Version 0.5.2

Description

When using version 0.5.2 of the package, the application crashes with an error related to the exports keyword in an ES module.

Steps to Reproduce

  1. Install the package: npm install.
  2. Run the application npm run dev

Package.json

package.json

Expected Behavior

The application should start without errors.

Actual Behavior

The application crashes, and the following error is logged:


file:///path/to/node_modules/@brillout/vite-plugin-server-entry/dist/runtime/crawlServerEntry.js:2
Object.defineProperty(exports, "__esModule", { value: true });
                      ^

ReferenceError: exports is not defined in ES module scope
    at file:///path/to/node_modules/@brillout/vite-plugin-server-entry/dist/runtime/crawlServerEntry.js:2:23
    at ModuleJobSync.runSync (node:internal/modules/esm/module_job:341:35)
    at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:317:47)
    at loadESMFromCJS (node:internal/modules/cjs/loader:1381:24)
    at Module._compile (node:internal/modules/cjs/loader:1503:5)
    at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
    at Module.load (node:internal/modules/cjs/loader:1317:32)
    at Module._load (node:internal/modules/cjs/loader:1127:12)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
brillout commented 3 days ago

Do you also get this error with 0.5.1?

buituansonHE172207 commented 3 days ago

I have rolled back my application to version 0.5.1, and it is now working normally without any issues.

brillout commented 3 days ago

Fix released in 0.5.3.

buituansonHE172207 commented 3 days ago

Thank you for the quick response! I’ve tested the new version, and it is now working correctly in my project. I appreciate your support in resolving this issue.