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.

Syntax error: Octal literal in strict mode (9:50)

See original GitHub issue

Hello,

I really liked the demonstration of the module so I thought why not try it. After installing the module globally, I’ve created the app, navigated to the folder, ran npm start and this is what it printed. I haven’t touched anything.

> react-static start


=> Copying public directory...
=> [✓] Public directory copied: 5.597ms
=> Building Routes...
More than one route is defined for path: /
More than one route is defined for path: /
=> [✓] Routes Built: 153.290ms
=> Building App Bundle...
=> [✓] App serving at http://localhost:3000

Failed to rebuild.
./dist/react-static-routes.js
Syntax error:  Octal literal in strict mode (9:50)

   7 | import src_containers_Post from '..\src\containers\Post'
   8 | import src_containers_Blog from '..\src\containers\Blog'
>  9 | import src_containers____ from '..\src\containers\404'
     |                                                   ^
  10 |     const templateMap = {
  11 |     t_0: src_containers_Home,
  12 | t_1: src_containers_About,

Also, there are lots of Babel module warnings that something is deprecated. Something for ES7.

react-static v4.3.0

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
karlandcommented, Nov 22, 2017

I have the same problem on Windows. Even on Windows the import paths should have forward slashes:

RIGHT:

import src_containers_404 from '../src/containers/404'

WRONG:

import src_containers_404 from '..\src\containers\404'

Now, when arriving at \404 node thinks \4 is an Octal. I have made PR #191 to fix the issue.

1reaction
ImranMHcommented, Nov 21, 2017

I have face the same problem in my windows machine . It show the message below

`User@DESKTOP-B4M1POT MINGW64 /g/working/react/react-static $ yarn start yarn start v0.21.3 $ react-static start

=> Copying public directory… => [✓] Public directory copied: 8.141ms => Building Routes… => [✓] Routes Built: 682.275ms => Building App Bundle… => [✓] App serving at http://localhost:3000 Failed to rebuild. ./dist/react-static-routes.js Syntax error: G:/working/react/react-static/dist/react-static-routes.js: Octal l iteral in strict mode (9:50)

7 | import src_containers_Post from ‘…\src\containers\Post’ 8 | import src_containers_Blog from ‘…\src\containers\Blog’

9 | import src_containers_404 from ‘…\src\containers\404’ | ^ 10 | const templateMap = { 11 | t_0: src_containers_Home, 12 | t_1: src_containers_About, `

Read more comments on GitHub >

github_iconTop Results From Across the Web

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 >
Why are Octal numeric literals not allowed in strict mode (and ...
Octal literals are not allowed because disallowing them discourages programmers from using leading zeros as padding in a script.
Read more >
Error transforming with 'commonjs' plugin: Octal literal in strict ...
Hi I get this error. SyntaxError: Error transforming .../node_modules/jspm/lib/ui.js with 'commonjs' plugin: Octal literal in strict mode (467:28) in .
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. The...
Read more >
"0"-prefixed octal literals and octal escape seq. are deprecated
Octal literals and octal escape sequences are deprecated and will throw a SyntaxError in strict mode. With ECMAScript 2015 and later, the standardized...
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