Skip to content

🐛 [Bug]: Import opentiny error when sub-module define type: module #569

Closed
@gweesin

Description

@gweesin

Version

2.10.0

Vue Version

2.6.14

Link to minimal reproduction

https://github.com/gweesin/test-tiny-vue-in-vue2

you also can open it online by stackblitz:

https://stackblitz.com/github/gweesin/test-tiny-vue-in-vue2

Step to reproduce

  1. pnpm add -S @opentiny/vue@2
  2. import a component and use it
import { TimeLine } from "@opentiny/vue";

export default {
  render(h) {
    return h(TimeLine);
  },
};

What is expected

compile without error

What is actually happening

image

The problem is that sub-module (or alias component) defined type: module, so when import files, it must include suffix of files, but not.

The sub-module example
image

The import statement
image

actual:

import { isDate } from "@opentiny/vue-renderless/common/deps/date-util";

expect:

import { isDate } from "@opentiny/vue-renderless/common/deps/date-util.js";

Any additional comments (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions