Comments (26)
@direct-fuel-injection
are you sure you included all required babel plugins?
from fuse-box.
npm list | grep babel-preset
├─┬ [email protected]
├── [email protected] extraneous
├─┬ [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│ └─┬ [email protected]
│ └─┬ [email protected]
from fuse-box.
@direct-fuel-injection
i may be wrong but shouldn't
state = {
| ^
14 | isLoading: true
15 | }
be
state:{} //notice the double colon
from fuse-box.
That issue is coming from babel, no fusebox trace back is here
from fuse-box.
@nchanged he has syntax error above as i mentioned
from fuse-box.
@devmondo webpack + babel works with that code fine.
from fuse-box.
But if you get a babel error that means that fuse has nothing to do with it
from fuse-box.
@nchanged looks like babel-preset-stage-0 not included.
from fuse-box.
@devmondo babeljs.io/repl transformed code.
from fuse-box.
state = {} added this line to react-example demo code, samer error.
from fuse-box.
@nchanged do we use acorn
when we use babel
plugin ?
from fuse-box.
@direct-fuel-injection do you have repo so we can reproduce this ?
from fuse-box.
@devmondo no it skips it ...
from fuse-box.
@nchanged then most probably it is not fuse! as fuse dont modify the source code.
any ways if @direct-fuel-injection provide repo we will see if we can reproduce it.
from fuse-box.
@direct-fuel-injection config is fed to babel-core as is. Make sure you have it all installed (plugins, presets). And yes, if nothing helps we are ready to help as soon as you give us some sample code.
from fuse-box.
@nchanged, @devmondo forked react-example.
[09:43:01] Starting 'build'...
SyntaxError: unknown: Unexpected token (5:10)
3 | import logo from './logo.svg';
4 | class App extends Component {
> 5 | state = {
| ^
6 | title: 'example'
7 | }
8 | render() {
at Parser.pp$5.raise (/home/dfi/Projects/test-fuse-box/react-example-master/node_modules/babylon/lib/index.js:4333:13)
at Parser.pp.unexpected (/home/dfi/Projects/test-fuse-box/react-example-master/node_modules/babylon/lib/index.js:1705:8)
at Parser.pp$1.parseClassProperty (/home/dfi/Projects/test-fuse-box/react-example-master/node_modules/babylon/lib/index.js:2498:50)
at Parser.pp$1.parseClassBody (/home/dfi/Projects/test-fuse-box/react-example-master/node_modules/babylon/lib/index.js:2409:34)
at Parser.pp$1.parseClass (/home/dfi/Projects/test-fuse-box/react-example-master/node_modules/babylon/lib/index.js:2349:8)
at Parser.pp$1.parseStatement (/home/dfi/Projects/test-fuse-box/react-example-master/node_modules/babylon/lib/index.js:1789:19)
at Parser.pp$1.parseBlockBody (/home/dfi/Projects/test-fuse-box/react-example-master/node_modules/babylon/lib/index.js:2212:21)
at Parser.pp$1.parseTopLevel (/home/dfi/Projects/test-fuse-box/react-example-master/node_modules/babylon/lib/index.js:1723:8)
at Parser.parse (/home/dfi/Projects/test-fuse-box/react-example-master/node_modules/babylon/lib/index.js:1617:17)
at parse (/home/dfi/Projects/test-fuse-box/react-example-master/node_modules/babylon/lib/index.js:6657:37)
[09:43:02] Finished 'build' after 246 ms
from fuse-box.
@direct-fuel-injection , i downloaded your fork and after lots of testing, i found the problem.
you did not install babel-preset-stage-0
, install it and just add it to babel
preset presets: ["latest","stage-0"]
and everything works fine.
from fuse-box.
@devmondo I've found that sourceMaps: false
gives Acorn error: Unexpected token (5:10)
.
Can you checkout latest commits in react-example?
from fuse-box.
@direct-fuel-injection i just tested it and it runs fine without error, again try to delete fuse cache folder and node_modules folder and start from scratch and let us know.
from fuse-box.
@devmondo after cache cleared same error.
What information do you need to reproduce this?
from fuse-box.
@nchanged do you have any idea about why this would cause sourcemaps errors with @direct-fuel-injection ?
on my machine, i tested with source maps, and everything looks fine and i get no errors.
@direct-fuel-injection, if you get the same error even after installing babel preset and removing cache, then there is something really odd!!! i attached screen shot to show you it is working
from fuse-box.
@devmondo turn off sourcemaps, or update to latest commit in my fork of react-example.
from fuse-box.
from fuse-box.
Experiencing this on v1.3.115
.babelrc
{
"sourceMaps": true,
"presets": [
"latest",
"stage-0"
],
"plugins": [
"transform-class-properties",
"transform-react-jsx"
]
}
offending js
export default class Editor extends Component {
let codeblock = null
let codewrap = null
componentDidMount() {
this.editor = new Misbehave(codeblock)
}
render() {
<pre refs={() => {codewrap = pre}}>
<code
className="language-javascript"
contenteditable="true"
autocorrect="off"
autocapitalize="off"
spellcheck="false"
ref={() => {codeblock = code}}></code>
</pre>
}
}
error output
SyntaxError: unknown: Unexpected token, expected ( (7:6)
5 |
6 | export default class Editor extends Component {
> 7 | let codeblock = null
| ^
8 | let codewrap = null
9 |
10 | componentDidMount() {
from fuse-box.
And.... please disregard... had the wrong syntax for class properties.
mea culpa
from fuse-box.
Have u tried nuking? (Cache)
from fuse-box.
Related Issues (20)
- pluginConsolidate not working HOT 1
- "manifest" RunProps are ignored
- css background-image url with @ in path is not managed as resource HOT 7
- incorrect removal of parentheses in `(-(--t))`
- fuse-box@4 vue2.x.x .vue files support
- Log output indicates that `'@'` characters in file paths are changed into `'undefined'`
- Incorrect processing of awaited brackets
- ESM output support HOT 3
- Node_modules folder debug HOT 1
- node-sass is deprecated HOT 2
- Sass, and non-existent .css.map files HOT 2
- Failed to resolve %23clip in a css file HOT 4
- Transpilation Error with fuse-box 4.0.0 (or maybe I'm simply blind) HOT 1
- 4.0.0 Dependency bundled as two separate instances in production build
- `rootDir` does not exist in type IPublicOutputConfig
- Cannot find module: fuse-box/sparky HOT 7
- Is it possible to share an assets folder between two projects?
- Support Angular 13
- TypeError: Cannot read property 'filename' of undefined HOT 4
- Archive project
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fuse-box.