UglifyJS fails to process tmi.js in my React/Webpack project
See original GitHub issueActual behaviour: When using tmi.js as a dependency in my React/Webpack/UglifyJS project, UglifyJS fails to process tmi.js.
Expected behaviour: UglifyJS processes tmi.js without error.
Error log:
Unexpected character '`'
… referring to the back-ticks in lib/*.js
. It seems like tmi.js is not being compiled down to ES5.
Server configuration
- Operating system: Windows 10
- Node version (if applicable): 6/8
- NPM version (if applicable): 3/5
- tmi.js version: 1.2.1
Workaround
- Manually build tmi.js and import tmi.min.js into your project:
import 'tmi.min.js'; // works; tmi is part of the global scope (not ideal) import tmi from 'tmi.min.js' // does NOT work; tmi is undefined
- Instruct Webpack to compile tmi.js when building by adding the following to your Webpack config’s
module.loaders
array:{ // Compile delinquent modules test: /\.js$/, loader: 'babel-loader', include: [ // tmi.js path.dirname(require.resolve('tmi.js')), ], query: { babelrc: false, presets: ['es2015'], }, }
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (1 by maintainers)
Top Results From Across the Web
ERROR in bundle.js from UglifyJs - javascript - Stack Overflow
In my case i did changed sourceMap:false So error came like. ERROR in index.bundle.js from UglifyJs TypeError: Cannot read property 'sections' of null....
Read more >Bot doesn't send message anymore and throws an error
Today, as a fun project, I tried making a Chatbot for the first time ever. I followed a tutorial, and i created it...
Read more >README-Node.md - kaxap/arl - Sourcegraph
STARS FORKS ISSUES LAST COMMIT
95339 9729 176 15 days ago
61648 8464 324 28 days ago
44926 6686 67 17 days ago
Read more >Welcome to Everything.js | Everything.js
Welcome to Everything.js. A curated list of awesome JavaScript frameworks, libraries and software. freeCodeCamp/freeCodeCamp - The https://www.
Read more >Gitiles - Code Review - GerritHub
NET and Node.js code in-process on Windows, MacOS, ... project using GitHub Maven PluginsAKASH007045/javaThe Squash client library for Java ...
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
Nvm, I seen the PR you had and just installed that instead. Works perfectly, thanks for your help I hope this get’s merged soon
@AhadCove Download the latest minified version of
tmi.js
and put it wherever scripts go.