Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken with Babel 7 #11

Open
chrisvfritz opened this issue Feb 24, 2018 · 5 comments
Open

Broken with Babel 7 #11

chrisvfritz opened this issue Feb 24, 2018 · 5 comments

Comments

@chrisvfritz
Copy link

chrisvfritz commented Feb 24, 2018

I'm not sure if the bug is here or in babel-plugin-transform-vue-jsx, but trying to use v-model in Babel 7 results in this error:

This API has been removed. If you're looking for this functionality in Babel 7, you should import the '@babel/helper-module-imports' module and use the functions exposed  from that module, such as 'addNamed' or 'addDefault'.

  at File.addImport (node_modules/@babel/core/lib/transformation/file/file.js:112:11)
  at PluginPass.addImport (node_modules/@babel/core/lib/transformation/plugin-pass.js:30:22)
  at buildOpeningElementAttributes (node_modules/babel-plugin-transform-vue-jsx/index.js:182:25)
  at buildElementCall (node_modules/babel-plugin-transform-vue-jsx/index.js:116:17)
  at PluginPass.exit (node_modules/babel-plugin-transform-vue-jsx/index.js:20:26)
  at newFn (node_modules/@babel/traverse/lib/visitors.js:223:21)
  at NodePath._call (node_modules/@babel/traverse/lib/path/context.js:64:19)
  at NodePath.call (node_modules/@babel/traverse/lib/path/context.js:38:17)
  at NodePath.visit (node_modules/@babel/traverse/lib/path/context.js:108:8)
  at TraversalContext.visitQueue (node_modules/@babel/traverse/lib/context.js:135:18)

Possibly related to vuejs/babel-plugin-transform-vue-jsx#112.

@LinusBorg
Copy link

LinusBorg commented Feb 26, 2018

It seems that's fixable. someone already posted a fixed fork for babel-plugin-transform-vue-jsx in the issue you linked to, and it looks pretty simple:

wietseva/babel-plugin-transform-vue-jsx@1b9ebad

@nickmessing
Copy link
Owner

Yep, sorry guys, I'll try to get https://github.com/vuejs/jsx done by the end of the week, will completely redo v-model and event modifiers and make that all a part of that monorepo.

@chrisvfritz
Copy link
Author

Woohoo! Thanks @nickmessing. 😄

@sant123
Copy link

sant123 commented Apr 25, 2018

Any advance on this? For now this is my approach:

<div>
    <input type="text" onInput={e => this.firstName = e.target.value} value={this.firstName} />
    <Home firstName={this.firstName} />
</div>

@dmrickey
Copy link

dmrickey commented Jun 13, 2019

It seems to me that this is still broken..

edit: Never mind, it looks like all is well if you follow @nickmessing 's link and also install https://github.com/vuejs/jsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants