#GitHub - brunocalado/compass-for-sequenc...

1 messages · Page 1 of 1 (latest)

keen shadow
#

on line 2, you are doing

import {Compass} from './compass.mjs'

but the file name is compass.js mot .mjs

tribal swift
#

fixed and tested

#

I don't undertand why this is happening. I just copied this code from a working module.

#

I hate these ghost bugs. 😦

keen shadow
#

Stuff happens

#

Can you add this code at line 11 on the init.js script

console.debug('Compass',  {
  module: game.modules.get('compass-for-sequencer'),
  comapss: Compass
});

and let me know what that outputs in the console when you refresh?

tribal swift
# keen shadow Can you add this code at line 11 on the init.js script ```js console.debug('Comp...

It don't display on the console. I think it's related.

manifest.json
"esmodules": [
"/scripts/init.js"
],

init.js

const moduleName = 'compass-for-sequencer';
import {Compass} from './compass.js'


Hooks.once('init', () => {
//Hooks.once('setup', () => {
  // --------------------------------------------------
  // Load API
  // Request with: const compass = game.modules.get('compass-for-sequencer')?.api.compass;
  //game.modules.get('compass-for-sequencer').api = { compass }; 
  game.modules.get('compass-for-sequencer').api = { compass: Compass };
  
  console.log('==========================')
  console.debug('Compass',  {
    module: game.modules.get('compass-for-sequencer'),
    compass: Compass
  });
  console.log('==========================')
  
  // --------------------------------------------------
  // Module Options

});




#

init.js is not being executed.

keen shadow
#

comment out your import and replace compass in the init.js files with {}

I suspect your code is breaking and never being run

tribal swift
#

What is the right way to do: import {Compass} from './compass.js' ?

keen shadow
#

change .debug to .log, I suspect you have debug statements hidden in your console.

#

That is the correct way to import which means something is breaking in that class and stopping the code from running

tribal swift
keen shadow
#

Alright, give me a minute I gotta look through your compass.js code

#

You can just remove the let and do sequence = new Sequence()...

keen shadow
#

Does that work?