-1

I’m using N/Log module in Client Scripts in my bundle. But got an error "TypeError: log.debug is not a function" in one of NetSuite Account that uses my bundle.

when I try to load N/Log module using the browser console N / log module is injected as a Suitelet 1.0 function instead of the Suitelet 2.0 Module.

My questions are:

  • Is it possible to explicitly inject or redefine N/Log Suitelet 2.0 Module in Client Script?
  • What can affect the injection of modules? (other scripts or NS configuration)
/**
 *@NApiVersion 2.0
 *@NScriptType ClientScript
 *@NModuleScope Public
 */

define(
[
  'N/record',
  'N/search',
  'N/currentRecord',
  'N/url',
  'N/https',
  'N/runtime',
  'N/ui/dialog',
  'N/log',
  'N/error',

],
function(
  record,
  search,
  currentRecord,
  url,
  https,
  runtime,
  dialog,
  log,
  error,

) { ... }

Kadavar
  • 1
  • 2

2 Answers2

0

The means one of the declarations before log is not a true module

Coldstar
  • 1,324
  • 1
  • 12
  • 32
-1

You may use: log('type', 'title', 'details')

Example:

log('debug', 'Test', x);
4b0
  • 21,981
  • 30
  • 95
  • 142
Red
  • 1
  • 3