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.

Warning during babel compilation with webpack-dev-server

See original GitHub issue

Context

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:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
SwiToolcommented, Oct 13, 2018

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 nor babel-runtime Thank you.

0reactions
SwiToolcommented, Oct 4, 2018

Thanks for your answer, i’ll get back soon to tell the news about it.

Read more comments on GitHub >

github_iconTop 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 >

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