Skip to content

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

@katerlouis

Description

@katerlouis

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

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