`init is not defined` when transpiled with webpack
See original GitHub issueI’m trying to transpile my project which has some dependencies that are using debug
, and I got an error when I try to transpile it with this webpack config :
{
target : "node",
module : {
rules : [{
test : /\.js$/,
loader : "babel-loader",
options : {
babelrc : false,
presets : [
["@babel/preset-env", {
"targets": {
"node": "6.11.2"
}
}]
]
}
}]
}
}
The stacktrace is leading me to "./node_modules/debug/src/node.js"
with this error "ReferenceError: init is not defined"
I’m using node.js v12.13.1, with webpack 4.41.5 and babel 7.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
init is not defined when transpiled with webpack #735 - GitHub
I'm trying to transpile my project which has some dependencies that are using debug, and I got an error when I try to...
Read more >How to transpile ES modules with webpack and Node.js
Learn how webpack interacts with and supports ES modules in this deep dive tutorial on transpilation in Node.js.
Read more >Webpack not transpiling Typescript - Stack Overflow
I tried awesome-typescript-loader and ts-loader but both are not working when I try to use ES6/TypeScript features in my code, like defining ......
Read more >TypeScript - webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >cannot access before initialization webpack - You.com | The AI ...
With transpiled code it just logs undefined . It only gives an error with native modules no matter if the export is a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@yvele @gdepouilly Closing for now. Feel free to link back to this issue from the issue you open with Microsoft, for visibility and tracking purposes. 😃
Honestly, it looks like microsoft’s engine doesn’t support function hoisting, which is odd since it’s part of the javascript specification.