Unexpected token: name (absPath)
See original GitHub issueBug 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:
- Created 5 years ago
- Comments:15 (3 by maintainers)
Top 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 >
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 Free
Top 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
How do you compile the files under
util/
? Do you use the webpack config in App for them?change the file path all file paths cannot be on the upper layer of .Babelrc