Skip to content

Can't use this with typescript/node16? #37

@Lokomojo

Description

@Lokomojo

import escapeStringRegexp from 'escape-string-regexp';

Typescript compiles this down to

const escape_string_regexp_1 = require("escape-string-regexp");

which causes Node to throw

[ERROR] uncaughtException: require() of ES Module node_modules\escape-string-regexp\index.js from dist\backend\classes\UiClient.js not supported.
Instead change the require of index.js in dist\backend\classes\UiClient.js to a dynamic import() which is available in all CommonJS modules.

I don't have this issue with any other module; how can I work around this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions