Giter Club home page Giter Club logo

Comments (7)

alangpierce avatar alangpierce commented on May 14, 2024 2

Thanks, glad to hear! I'll actually reopen to track the task of updating the docs and maybe adding a runtime check.

from sucrase.

alangpierce avatar alangpierce commented on May 14, 2024 1

@iki Take a look at webpack/webpack#5548 (comment) , that may have some pointers. I think there are unfortunately some node_modules issues where it's possible to be stuck on an old acorn even though webpack 4 should depend on a recent enough version that supports the syntax. The syntax works for me in webpack 4 with a fresh install, so maybe try reinstalling node_modules from scratch or regenerating your lockfile.

from sucrase.

alangpierce avatar alangpierce commented on May 14, 2024

Thanks for reporting. Since you're on webpack 4, I think object rest/spread should actually work without webpack-object-rest-spread-plugin. I wrote that plugin before webpack 4 came out, and it's still needed on 3 or earlier. Could you try removing that plugin and see if it works and that you can still have object rest/spread in your code?

I'll update the docs to say that webpack-object-rest-spread-plugin is not needed in webpack 4. It looks like webpack 4 changed enough to break the plugin, so I'll also see if I can make it print a warning and do nothing if it detects that you're on webpack 4.

from sucrase.

dan-lee avatar dan-lee commented on May 14, 2024

Oh yeah, it works without. I just blindly assumed it was necessary.
Thank you, and keep up the nice project :)

from sucrase.

iki avatar iki commented on May 14, 2024

@alangpierce Actually, I get the above error with webpack4, typescript and webpack-object-rest-spread-plugin. However, if I remove the spread plugin, I get error on the first spread operator:

ERROR in ./src/containers/App.tsx
Module build failed: SyntaxError: ./src/containers/App.tsx: Unexpected token (17:37)

> 17 | const SwitchWithProps = ({ children, ...restProps }) => (

from sucrase.

iki avatar iki commented on May 14, 2024

@alangpierce thanks! updating acorn resolved that: webpack/webpack#5548 (comment)

from sucrase.

alangpierce avatar alangpierce commented on May 14, 2024

Cool, glad to hear.

from sucrase.

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.