plugins
plugins copied to clipboard
[@rollup/plugin-commonjs] ReferenceError: Cannot access 'X' before initialization
- Rollup Plugin Name: plugin-commonjs
- Rollup Plugin Version: 22.0.1
- Rollup Version: 2.51.2
- Operating System (or Browser): Windows 10
- Node Version: 16.15.0
- Link to reproduction (⚠️ read below): https://replit.com/@lazuee/rollup-plugin-repro
Expected Behavior
The code should be working properly,.
Actual Behavior
file:///home/runner/rollup-plugin-repro/lib/index.mjs:1064
class MessageOptions extends BaseOptions {
^
ReferenceError: Cannot access 'BaseOptions' before initialization
at file:///home/runner/rollup-plugin-repro/lib/index.mjs:1064:30
at ModuleJob.run (node:internal/modules/esm/module_job:185:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:281:24)
This error occured when i used this plugin, the BaseOptions class should be on top of the extends class but the MessageOptions is on the top of the BaseOptions class, that's why i get this error
Additional Information
class MessageOptions extends BaseOptions {
constructor(message) {
super();
Object.defineProperty(this, "message", {
enumerable: true,
configurable: true,
writable: true,
value: void 0
});
this.message = message;
}
}
class BaseOptions {
isInteraction() {
return this instanceof InteractionOptions;
}
isMessage() {
return this instanceof MessageOptions;
}
constructor() { }
}
class InteractionOptions extends BaseOptions {
constructor(interaction) {
This is the code in the /lib/index.mjs file, the MessageOptions should be not on top of the BaseOptions class
Here is the code of that MessageOptions: https://replit.com/@lazuee/rollup-plugin-repro#src/commands/data/messageOptions.ts
I Don't know, if this is in the plugins-commonjs bug, or rollup bug,.
Because this is also the error that i got in lib/index.cjs file
Hey folks. This issue hasn't received any traction for 60 days, so we're going to close this for housekeeping. If this is still an ongoing issue, please do consider contributing a Pull Request to resolve it. Further discussion is always welcome even with the issue closed. If anything actionable is posted in the comments, we'll consider reopening it. ⓘ