Skip to content
New issue

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

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

Already on GitHub? # to your account

Uncaught ReferenceError: DEBUG is not defined | Stage.js 0.9.4 + Vue.js v3.3.4 #63

Open
LuckyFox31 opened this issue Jul 22, 2023 · 3 comments

Comments

@LuckyFox31
Copy link

LuckyFox31 commented Jul 22, 2023

Stage.js version : 0.9.4
Vue.js version 3.3.4
Development environment : Vite
Package manager : PNPM 8.6.9

I created a small project with the Vue.js framework to test the Stage.js library.

When I try to import the library I get an error:

Uncaught ReferenceError: DEBUG is not defined
    at node_modules/.pnpm/stage-js@0.9.4/node_modules/stage-js/lib/core.js (core.js:2:3)
    at __require (chunk-76J2PTFD.js?v=a126181c:3:50)
    at node_modules/.pnpm/stage-js@0.9.4/node_modules/stage-js/lib/index.js (index.js:1:18)
    at __require (chunk-76J2PTFD.js?v=a126181c:3:50)
    at node_modules/.pnpm/stage-js@0.9.4/node_modules/stage-js/platform/web.js (web.js:1:18)
    at __require (chunk-76J2PTFD.js?v=a126181c:3:50)
    at web.js:16:1

This error appears in this import:

import {Stage} from "stage-js/platform/web.js"

I also tried this import:

import {Stage} from "stage-js"

Here is my code :

<script setup>
  // -- Dependencies --
  import {ref, onMounted} from "vue";
  import {Stage} from "stage-js/platform/web.js" // <-- Here

  // -- References --
  const gameContainer = ref(null);

  // -- Variables --
  let stage;

  // -- Life cycles --
  onMounted(() => {
    stage = new Stage(gameContainer.value);
  })
</script>

<template>
  <div ref="gameContainer"></div>
</template>

<style scoped>
  div{
    width: 1000px;
    height: 1000px;
  }
</style>

Has anyone ever encountered this error?
How can I solve this problem?

@shakiba
Copy link
Collaborator

shakiba commented Jul 22, 2023

Hi @LuckyFox31 , please temporary add var DEBUG = false; or true to your code, I'm working on a new major update, but will make an minor update to just a fix this issue today.

@shakiba
Copy link
Collaborator

shakiba commented Jul 24, 2023

I published 0.9.5, could you please try again?

@LuckyFox31
Copy link
Author

It works, thank you.

But now I have to use this syntax to import the library:

import * as Stage from "stage-js" // Work

import {Stage} from "stage-js/platform/web.js" // Not working
import {Stage} from "stage-js"// Not working

I can't wait to see the new version! ;)

Thanks for the fix!

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

No branches or pull requests

2 participants