Skip to content

fix: es-modules information #123

@mrhammadasif

Description

@mrhammadasif

Unable to proceed with es-build e.g. vite-ssg build when using this Library https://github.com/HC200ok/vue3-easy-data-table, package.json needs to be updated

There is a repro, you can see at https://stackblitz.com/edit/github-9mnuxu?file=src/pages/table.vue&view=editor

Getting this Error:

An internal error occurred.
[vite-ssg] Please report an issue, if none already exists: https://github.com/antfu/vite-ssg/issues
/home/projects/github-9mnuxu/node_modules/vue3-easy-data-table/dist/vue3-easy-data-table.es.js:20
import { defineComponent, useCssVars, unref, computed, inject, openBlock, createElementBlock, withModifiers, createElementVNode, normalizeClass, pushScopeId, popScopeId, ref, watch, onMounted, onBeforeUnmount, toDisplayString, Fragment, renderList, useSlots, renderSlot, createCommentVNode, toRefs, provide, normalizeStyle, createBlock, normalizeProps, mergeProps, guardReactiveProps, createTextVNode, createVNode, isRef, createSlots, withCtx } from "vue";
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at Object.compileFunction (https://github-9mnuxu.w.staticblitz.com/blitz.b2ae50562a0bdf31ecd871b5c7a8c6dd539613de.js:6:341448)
    at wrapSafe (https://github-9mnuxu.w.staticblitz.com/blitz.b2ae50562a0bdf31ecd871b5c7a8c6dd539613de.js:6:218347)
    at Module._compile (https://github-9mnuxu.w.staticblitz.com/blitz.b2ae50562a0bdf31ecd871b5c7a8c6dd539613de.js:6:218715)
    at Module._extensions..js (https://github-9mnuxu.w.staticblitz.com/blitz.b2ae50562a0bdf31ecd871b5c7a8c6dd539613de.js:6:219743)
    at Module.load (https://github-9mnuxu.w.staticblitz.com/blitz.b2ae50562a0bdf31ecd871b5c7a8c6dd539613de.js:6:217769)

antfu-collective/vite-ssg#292

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