Warning during babel compilation with webpack-dev-server
See original GitHub issueContext
Tested on OSX 10.13.1 & W10 : prevents the app from starting (with webpack-dev-server)
- Telegraf.js Version: ^3.23.1
- Node.js Version: 8.7.0
- Operating System: Windows 10
Expected Behavior
There should not be any warning during babel compilation
Current Behavior
I get a warning. My app is locked from starting. If I comment the import of Telegraf, my window pops up, and I can then uncomment, webpack-dev-server will refresh my window and it will work as expected. But the issue here is the first run with webpack-dev-server.
Failure Information
WARNING in ./node_modules/encoding/lib/iconv-loader.js
9:12-34 Critical dependency: the request of a dependency is an expression
@ ./node_modules/encoding/lib/iconv-loader.js
@ ./node_modules/encoding/lib/encoding.js
@ ./node_modules/node-fetch/lib/index.mjs
@ ./node_modules/telegraf/core/network/client.js
@ ./node_modules/telegraf/telegram.js
@ ./node_modules/telegraf/telegraf.js
@ ./src/renderer/main/bot/util/Notifications/Telegram.js
@ ./src/renderer/main/bot/Bot.js
@ ./src/renderer/main/app/App.js
@ ./src/renderer/main/index.js
@ ./src/renderer/index.js
@ multi (webpack)-dev-server/client?http://localhost:9080 webpack/hot/dev-server ./src/renderer/index.js
┏ Renderer -------------------
webpack: Compiled with warnings.
┗ ----------------------------
Steps to Reproduce
Just :
const Telegraf = require('telegraf')
produces the error.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
reactjs - Webpack-Dev-Server: Errors while compiling. Reload ...
This issue seems to happen with eslint-loader where hot module replacement is used along with emitWarning: false (which is the default value):.
Read more >How I solved and debugged my Webpack issue through trial ...
When webpack bundles your source code, it can become difficult to track down errors and warnings to their original location.
Read more >DevServer - webpack
If you want to manually recompile the bundle, navigating to the /webpack-dev-server/invalidate route will invalidate the current compilation of the bundle and ...
Read more >ts-loader - npm
Use "vanilla" ts-loader; I want the fastest compilation that's available. ... ts-loader works very well in combination with babel and ...
Read more >3 warnings in child compilations (use 'stats.children: true' resp ...
Edit : Adding sourceType: 'unambiguous', to the options of webpack configuration file to the babel-loader fixes it. You might have to edit babel.config...
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 Free
Top 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
You were right, I was doing it wrong by putting it in the renderer process. I don’t have the error by putting it in the production dependencies. I didn’t have to install
babel-plugin-transform-runtime
norbabel-runtime
Thank you.Thanks for your answer, i’ll get back soon to tell the news about it.