Coder Social home page Coder Social logo

rewire doesn't work with babel about rewire HOT 9 CLOSED

jhnns avatar jhnns commented on May 22, 2024
rewire doesn't work with babel

from rewire.

Comments (9)

srph avatar srph commented on May 22, 2024

Having the same issue as well.

from rewire.

jhnns avatar jhnns commented on May 22, 2024

Yes, probably the same error as in jhnns/rewire-webpack#12

from rewire.

jhnns avatar jhnns commented on May 22, 2024

Is React using Babel for transpiling?

from rewire.

mikeyamadeo avatar mikeyamadeo commented on May 22, 2024

+1

Using Babel for transpiling.

from rewire.

jhnns avatar jhnns commented on May 22, 2024

I can't see how this could be fixed by my side. As @sairion pointed out, babel is changing variable names. Thus all uses of eval() will not work as expected.

I hope babel will do something about it. Although eval() should not be used in day-to-day code, it is still part of the language and will not be deprecated.

from rewire.

damassi avatar damassi commented on May 22, 2024

This is super disappointing as Rewire is the most useful library ever! It might be worthwhile to start a discussion with the Babel folks.

I'll go ahead and close.

from rewire.

doctyper avatar doctyper commented on May 22, 2024

Hm, then we may have a problem. Babel says it's not their issue: babel/babel#1337

from rewire.

JustinTulloss avatar JustinTulloss commented on May 22, 2024

For what it's worth, @speedskater has written an alternative that works with Babel's ES6 module compilation. https://github.com/speedskater/babel-plugin-rewire

from rewire.

d4nyll avatar d4nyll commented on May 22, 2024

Note that babel-plugin-rewire does not currently work with Babel 7. See Babel 7 Support? #209 for more details.

from rewire.

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.