question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to import and use debug using es6 import syntax

See original GitHub issue
import Debug from 'debug';
const debug = Debug('myapp');

I am trying to above syntax, app runs as expected but no debug output is shown

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
williamokanocommented, Mar 27, 2019

This doesn’t make sense @Qix- , the question is how to import using ES6 import syntax, not how to use the lib. In the readme they only teach how to import it using require.

BTW, I’m also looking for this answer

0reactions
YuriyVorobyov1333commented, Oct 1, 2020

import Debug from “debug”; const debug = Debug(“MyApp”);

// then to use debug(“Something happened”);

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to import and use debug using es6 import syntax #692
import Debug from 'debug'; const debug = Debug('myapp'); I am trying to above syntax, app runs as expected but no debug output is...
Read more >
Setup and debug Jest to use ES6 imports in Node v12.x.x
This guide navigates the maze of Jest configurations when trying to use ES6 imports in v12 of Node.
Read more >
ES6 module import is not defined during debugger
I threw a debugger in my main.js to see if I was importing correctly, but Chrome's console kept yelling that the module I...
Read more >
How to enable ES6 (and beyond) syntax with Node and Express
js /** * Module dependencies. */ import app from '../app'; import debugLib from 'debug'; import http from 'http'; const debug = debugLib ......
Read more >
Debugging ES6 Code in Node.js - Atomic Spin
Option 1: The Built-In Debugger. Let's take the example from the aforementioned post, but modify it with some ES6 syntax: JavaScript. import ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found