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.

[Angular 5] Module parse failed: Octal literal in strict mode

See original GitHub issue

Hello,

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

  1. Create a new Angular 5 project with the latest version of angular-cli
  2. Integrate xterm.js basic example from the readme as explained there
  3. Run npm start

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
ficristocommented, Mar 2, 2018

This seems related to the "use strict" directive. Does using the hexadecimal sequence work for you? Instead of \033 try \x1b.

0reactions
PiePaniccommented, Apr 19, 2018

answer from @ficristo worked

Read more comments on GitHub >

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

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