Non-working import


#1

Hi!

I have a import that doesn’t work:

import { verifyUsers, verifyProducts, verifyClients, verifyExtraFields } from "/lib/tasks/analyzers/verifyEntities.js"
// verifyUsers == undefined.

import * as banana from "/lib/tasks/analyzers/verifyEntities.js"
console.log(banana) 
/** Returns:
  *  { __esModule: true,
  * I20160805-13:06:25.123(-3)?   verifyProducts: undefined,
  * I20160805-13:06:25.124(-3)?   verifyUsers: undefined,
  * I20160805-13:06:25.124(-3)?   verifyClients: undefined,
  * I20160805-13:06:25.124(-3)?   verifyExtraFields: undefined }
*/

Code for verifyEntities.js:

export const verifyProducts = function (obj) {
  return verifyEntities(obj, 'products', 'Product');
};

export const verifyUsers = function verifyUsers(obj) {
  return verifyEntities(obj, 'users', 'User');
};

export const verifyClients = function verifyClients(obj) {
  return verifyEntities(obj, 'clients', 'Client');
};

Someone had this bug?

Currently I saw this Stackoverflow post without answers :(.


#2

Forget it. The problem was a circular import (file “a” has: import b from ‘b.js’, file “b” has: import a from ‘a.js’). Thanks!