Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

ReferenceError: module is not defined in ES module scope #109

Closed
@xiaoxiangmoe

Description

@xiaoxiangmoe

create a file a.mjs

// file a.mjs
import ScriptSetup from 'unplugin-vue2-script-setup/webpack';

console.log(ScriptSetup)

run node a.mjs

it throws error

file:///Users/me/repos/foo/node_modules/unplugin-vue2-script-setup/dist/webpack.mjs:954
module.exports = unplugin.webpack;
^

ReferenceError: module is not defined in ES module scope
    at file:///Users/me/repos/foo/node_modules/unplugin-vue2-script-setup/dist/webpack.mjs:954:1
    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)
    at async loadESM (node:internal/process/esm_loader:88:5)
    at async handleMainPromise (node:internal/modules/run_main:65:12)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions