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

Nuxt 3 (with Vite) issue on building static site: Cannot call a namespace ('JZZ') #80

Open
katerlouis opened this issue Feb 15, 2023 · 0 comments

Comments

@katerlouis
Copy link

katerlouis commented Feb 15, 2023

When I do import * as JZZ from 'jzz'; in my plugins/midi.client.ts file (which gets auto imported) everything is fine during $ npm run dev, but as soon as I go $ npm run generate I get this error:

Cannot call a namespace ('JZZ')

image

and in my Front-End
image

Which corresponds to this section (I guess?) in my entry.js:
image

I already tried importing like this:
import JZZ from 'jzz'

I also read this somewhere:

import * as JZZalias from 'jzz'
const JZZ = JZZalias

All without success :(

EDIT:
It looks like JZZ gets imported properly after all doing import JZZ from 'jzz', but the second .or() gets fired in production:

const input = JZZ()
  .or('somethings happening')
  .openMidiIn()
  .or('something else...') // I see this in production, why? :(
  .and(function() {
    console.log('Device connected:', this.name());
    store.midiDeviceName = this.name();
  });

In dev server, everything works as expected after seeing the log of Device connected: OP1 LE Bluetooth

@katerlouis katerlouis changed the title Nuxt 3 (with Vite) issue on building static site Nuxt 3 (with Vite) issue on building static site: Cannot call a namespace ('JZZ') Feb 15, 2023
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

1 participant