I'm encountering a problem when trying to import type definitions from a separate module in my Vue project.
Below is the structure of the typedefs I am attempting to import:
import { Server, createServer } from "net";
export namespace Testable {
export interface t {
1: string,
apple: boolean
}
export const enum b {
butter,
fly,
moth
}
export class apple extends Server {
}
}
While I can successfully import the namespace Testable
and use the interface t
, I encounter errors when trying to utilize the enum b
within Vue/webpack environment.
TypeError: Super expression must either be null or a function
The code provided is just a sample. However, when working with the live code that includes a database class, Vue/webpack indicates missing dependencies like cldr, dns, and others:
ERROR Failed to compile with 21 errors 2:00:58 PM
These dependencies were not found:
* cldr in ./node_modules/globalize/dist/globalize.js, ./node_modules/globalize/dist/globalize/message.js and 6 others
* cldr/event in ./node_modules/globalize/dist/globalize.js, ./node_modules/globalize/dist/globalize/message.js and 5 others
* cldr/supplemental in ./node_modules/globalize/dist/globalize/relative-time.js, ./node_modules/globalize/dist/globalize/plural.js and 3 others
* handlebars in ./node_modules/......
To clarify, my main goal is to import the enum without utilizing the nodejs class for browser execution.
Any assistance on resolving this issue would be highly valued! Additionally, suggestions for restructuring my project for better organization are welcome!