[Angular 5] Module parse failed: Octal literal in strict mode
See original GitHub issueHello,
I integrated xterm into my Angular 5 project, and everything works fine except the colors.
let term = new Terminal();
term.write('Hello from \033[1;3;31mxterm.js\033[0m $ ');
Be cause of the \033[
, this produces the following error :
Module parse failed: Octal literal in strict mode
You may need an appropriate loader to handle this file type.
Could you help me solve this problem? Thank you very much!
Details
- Browser and browser version: Chrome 63.0.3239.132
- OS version: Windows 10
- xterm.js version: 3.0.2
Steps to reproduce
- Create a new Angular 5 project with the latest version of angular-cli
- Integrate xterm.js basic example from the readme as explained there
- Run npm start
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Module parse failed: Octal literal in strict mode - Stack Overflow
Your regex contains \1 which is being interpreted as an octal, which is your error message. Octal escape sequences have been deprecated which...
Read more >SyntaxError: "0"-prefixed octal literals and octal escape seq ...
Octal literals and octal escape sequences are deprecated and will throw a SyntaxError in strict mode. The standardized syntax uses a leading ...
Read more >JavaScript SyntaxError - "0"-prefixed octal literals and octal ...
Cause of Error: Octal literals and octal escape sequences are deprecated and a SyntaxError will be thrown by them in strict mode.
Read more >"Octal literal in strict mode" error in Webpack - Bountysource
Webpack shows me an error at ./node_modules/bcrypt-nodejs/bCrypt.js (293:40), anyone know how to fix this? ERROR in .
Read more >JavaScript "use strict" - W3Schools
"use strict"; Defines that JavaScript code should be executed in "strict mode". The "use strict" Directive. The "use strict" directive was new in...
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
This seems related to the
"use strict"
directive. Does using the hexadecimal sequence work for you? Instead of\033
try\x1b
.answer from @ficristo worked