Coder Social home page Coder Social logo

Comments (26)

devmondo avatar devmondo commented on May 14, 2024

@direct-fuel-injection
are you sure you included all required babel plugins?

from fuse-box.

direct-fuel-injection avatar direct-fuel-injection commented on May 14, 2024

@devmondo

npm list | grep babel-preset
├─┬ [email protected]
├── [email protected] extraneous
├─┬ [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│   └─┬ [email protected]
│     └─┬ [email protected]

from fuse-box.

devmondo avatar devmondo commented on May 14, 2024

@direct-fuel-injection
i may be wrong but shouldn't

state = {
     |           ^
  14 |         isLoading: true
  15 |     }

be

state:{} //notice the double colon 

from fuse-box.

nchanged avatar nchanged commented on May 14, 2024

That issue is coming from babel, no fusebox trace back is here

from fuse-box.

devmondo avatar devmondo commented on May 14, 2024

@nchanged he has syntax error above as i mentioned

from fuse-box.

direct-fuel-injection avatar direct-fuel-injection commented on May 14, 2024

@devmondo webpack + babel works with that code fine.

from fuse-box.

nchanged avatar nchanged commented on May 14, 2024

But if you get a babel error that means that fuse has nothing to do with it

from fuse-box.

direct-fuel-injection avatar direct-fuel-injection commented on May 14, 2024

@nchanged looks like babel-preset-stage-0 not included.

from fuse-box.

direct-fuel-injection avatar direct-fuel-injection commented on May 14, 2024

@devmondo babeljs.io/repl transformed code.

from fuse-box.

direct-fuel-injection avatar direct-fuel-injection commented on May 14, 2024

state = {} added this line to react-example demo code, samer error.

from fuse-box.

devmondo avatar devmondo commented on May 14, 2024

@nchanged do we use acorn when we use babel plugin ?

from fuse-box.

devmondo avatar devmondo commented on May 14, 2024

@direct-fuel-injection do you have repo so we can reproduce this ?

from fuse-box.

nchanged avatar nchanged commented on May 14, 2024

@devmondo no it skips it ...

from fuse-box.

devmondo avatar devmondo commented on May 14, 2024

@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.

nchanged avatar nchanged commented on May 14, 2024

@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.

direct-fuel-injection avatar direct-fuel-injection commented on May 14, 2024

@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.

devmondo avatar devmondo commented on May 14, 2024

@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.

direct-fuel-injection avatar direct-fuel-injection commented on May 14, 2024

@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.

devmondo avatar devmondo commented on May 14, 2024

@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.

direct-fuel-injection avatar direct-fuel-injection commented on May 14, 2024

@devmondo after cache cleared same error.
What information do you need to reproduce this?

from fuse-box.

devmondo avatar devmondo commented on May 14, 2024

@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
image

from fuse-box.

direct-fuel-injection avatar direct-fuel-injection commented on May 14, 2024

@devmondo turn off sourcemaps, or update to latest commit in my fork of react-example.

from fuse-box.

nchanged avatar nchanged commented on May 14, 2024

#180

from fuse-box.

ada-lovecraft avatar ada-lovecraft commented on May 14, 2024

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.

ada-lovecraft avatar ada-lovecraft commented on May 14, 2024

And.... please disregard... had the wrong syntax for class properties.

mea culpa

from fuse-box.

nchanged avatar nchanged commented on May 14, 2024

Have u tried nuking? (Cache)

from fuse-box.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.