Debug: 2.5.0 incompatible with babel-core

Created on 21 Dec 2016  路  15Comments  路  Source: visionmedia/debug

babel-core directly imports debug/node. However, this export was removed in 2.5.0.

You can reproduce the issue with this repo. The following error is shown:

ERROR in Cannot find module 'debug/node'

Most helpful comment

I don't know

All 15 comments

please fix it immediately.

Just pushed 2.5.1. However, babel-core shouldn't be consuming node directly. That was the point of the index.js in previous versions. Will file an issue there

@mking-clari @maxzhang

It seem work fine. Thanks.

I don't know

babel-core use debug ^2.1.1.......

Well that was fun. I submitted an issue over there. Not sure why the folks at babel were referencing internal src files haha

Everything that's reachable is part of the public API, documented or not. Thanks for the quick fix!

@ljharb no problem, but I don't agree that every single source file is part of the "public API". If that is the case, then there is no private API in any codebase. The point of the index file was to delegate between node and browser

Indeed, that's accurate - unless you only distribute bundle files (one for each entry point you want to preserve) or use closure encapsulation, there's no private APIs in any codebase. It's a reasonable compromise, however, to only consider all top-level entry points automatically public, and to treat nested entry points as public only when documented.

That makes sense, but I think in this case the problem was a bit simpler than that. See this. Looks like babel-core had an issue with debug choosing the wrong environment but I don't think an issue was ever submitted about it :(

@thebigredgeek Exceptional work on the really fast fix and publish - thank you for dedicating your time and efforts to the project that we all rely on 馃憤

Hi,
I experienced the same thing with debug/browser. It was working up until the code was moved to the src directory - so it was working with version 2.4.5 - in 2.5.0 it is broken. Please add a file called browser.js in the main directory with the content

module.exports = require('./src/browser');

Thanks!

@gurkerl83 try v2.5.1

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Qix- picture Qix-  路  7Comments

BertCatsburg picture BertCatsburg  路  5Comments

LukeSheard picture LukeSheard  路  3Comments

anishkny picture anishkny  路  6Comments

dave-ops picture dave-ops  路  6Comments