Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

importing jkanban/dist/jkanban.min.js file throws an error #187

Closed
Javier1995 opened this issue Apr 16, 2023 · 4 comments
Closed

importing jkanban/dist/jkanban.min.js file throws an error #187

Javier1995 opened this issue Apr 16, 2023 · 4 comments

Comments

@Javier1995
Copy link

Javier1995 commented Apr 16, 2023

I am using vuejs3 and vite 4

My code is:

<script>
import("jkanban/dist/jkanban.min.js");
import("jkanban/dist/jkanban.min.css");

export default {
  name: "Kanban",
  mounted() {
    const bootstrap = this.$store.state.bootstrap;

    (function () {
      if (document.getElementById("myKanban")) {
        var KanbanTest = new jKanban({
          element: "#myKanban",
          gutter: "10px",
.........

image

@marcosrocha85
Copy link
Contributor

marcosrocha85 commented Apr 17, 2023

Unfortunately, jKanban doesn't support ESM modules. Have you tried import * as jKanban from "jkanban/dist/jkanban.min.js"?

@Javier1995
Copy link
Author

Javier1995 commented Apr 17, 2023

Thanks! I will give it a shot. It was working fine using vue cli but migrated it to vite

@marcosrocha85
Copy link
Contributor

@riktar can you close this issue?

@riktar riktar closed this as completed Jun 29, 2023
@tdeuling
Copy link

I've exacly the same issue by using the current master.
I try to import with import * as jKanban from "jkanban"; but it throws the error:

Uncaught (in promise) TypeError: Cannot set properties of undefined (setting 'jKanban')
    at jkanban.js?bust=1704019215:14:16
    at 1.dragula (jkanban.js?bust=1704019215:609:3)
    at o (jkanban.js?bust=1704019215:1:265)
    at r (jkanban.js?bust=1704019215:1:431)
    at jkanban.js?bust=1704019215:1:460

image

@Javier1995 how did you solve this issue!?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants