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.

Unexpected token: name (absPath)

See original GitHub issue

Bug Report

Current Behavior util/const/index.js:

var linkReplaceFunction = function () {
  let absPath = arguments[0];
  // ...

util/.babelrc:

{
  "presets": [
    "@babel/preset-env",
    [
      "@babel/preset-stage-0",
      {
        "decoratorsLegacy": true
      }
    ]
  ]
}

App/webpack.config.js:

   [
      {
        test: /\.(js|jsx)$/,
        exclude: /(node_modules|aliyun-sdk)/,
        use: [{
          loader: 'babel-loader',
        }],
      },
   ]

App/.babelrc:

{
  "presets": [
    "@babel/preset-env",
    "@babel/preset-react",
    ["@babel/preset-stage-0",{"decoratorsLegacy": true}]
  ],
  "plugins": [
    "transform-decorators-legacy",
    [
      "import",
      {
        "libraryName": "antd",
        "style": false
      }
    ]
  ]
}

Environment

  • Babel version(s): 7.0.0-beta.47
  • Node/npm version: 7.3
  • webpack 3.11.0

Possible Solution babel doesn’t work on util but work well on app

Additional context/Screenshots Add any other context about the problem here. If applicable, add screenshots to help explain.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nicolo-ribaudocommented, May 7, 2018

How do you compile the files under util/? Do you use the webpack config in App for them?

0reactions
goonwzzcommented, May 8, 2018

change the file path all file paths cannot be on the upper layer of .Babelrc

Read more comments on GitHub >

github_iconTop Results From Across the Web

bash: syntax error near unexpected token `(' - Python
The error message indicates that the script gets executed by bash, not python. Try adding #!/usr/bin/python as the first line of the file....
Read more >
Build failed SyntaxError: Unexpected token: name (length)
In my case, i was using the vue truffle box and Uglify was the issue as it was the uglify that came with...
Read more >
Python Examples of token.SLASH - ProgramCreek.com
This page shows Python examples of token.SLASH.
Read more >
6 Fixes For "syntax error near unexpected token"
How to Fix The “Syntax Error Near Unexpected Token” Error? ... xcb-aux; token alias; os.path.abspath'; oken newline'; newline' line 1 arch ' ...
Read more >
Configuration - Sphinx documentation
The configuration directory must contain a file named conf.py . ... path is relative to the configuration directory, use os.path.abspath() like so:.
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