Error: Found extraneous } in Chalk template literal
See original GitHub issueSteps to reproduce:
- Copy the code from Creating-middleware to a file named mw-example.js.
module.exports = MiddlewareBase => class Example extends MiddlewareBase {
middleware (options) {
return (ctx, next) => {
ctx.response.body = 'Hello'
}
}
}
- In the terminal write
./node_modules/.bin/ws --stack mw-example.js --help
if installed locally.
Error:
Error: Found extraneous } in Chalk template literal
at tmp.replace (/node_modules/chalk/templates.js:109:11)
at String.replace (<anonymous>)
at module.exports (/node_modules/chalk/templates.js:99:6)
at chalkTag (/node_modules/chalk/index.js:221:9)
at Chalk.chalk.template (/node_modules/chalk/index.js:36:20)
at format (/node_modules/command-line-usage/lib/chalk-format.js:4:10)
at chalkFormat (/node_modules/command-line-usage/lib/chalk-format.js:10:12)
at ansiFormatRow (/node_modules/command-line-usage/lib/content.js:76:16)
at content.map.row (/node_modules/command-line-usage/lib/content.js:35:52)
at Stack.map (<anonymous>)
Edit: removed beginning of paths in error output for brevity
local-web-server version: 2.6.1
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Better documentation of escape characters to avoid: throw ...
Hi I hit this error while using template literals for a long string. ... throw new Error('Found extraneous } in Chalk template literal');...
Read more >chalk tagged template literals within strings - Stack Overflow
i found a proxy for chalk that does just this const chalk = require("chalk"); const chalkish = (parts, ...substitutions) => { const ...
Read more >Template literals (Template strings) - JavaScript | MDN
Template literals are literals delimited with backtick (`) characters, allowing for multi-line strings, string interpolation with embedded ...
Read more >chalk-template - npm
Terminal string styling with tagged template literals. ... Start using chalk-template in your project by running `npm i chalk-template`.
Read more >restrict-template-expressions - TypeScript ESLint
This rule reports on values used in a template literal string that aren't primitives and don't define a more useful .toString() method. .eslintrc.cjs....
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
Fixed and released in lws v1.3.2, please re-install local-web-server to pick up the change. Thanks for letting me know. 👍
Makes sense… I’m actually working on both projects atm.
Yes, I will clarify everything in the README as part of the next release, thanks.