bublejs / buble

https://buble.surge.sh
MIT License
871 stars 67 forks source link

compile error with for...of #256

Closed mesqueeb closed 4 years ago

mesqueeb commented 4 years ago

error:

  name: 'CompileError',
  loc: {
    line: 133,
    column: 6,
    char: 132,
    file: '/Users/lucaban/.ghq/github.com/mesqueeb/planetar/api-card/src/components/ApiCard.vue?rollup-plugin-vue=script.js'
  },
  snippet: '129 :       const { description, props = [], methods = [], slots = [], events = [] } = vueDocgenData\n' +
    '130 :       if (isFullString(description)) {\n' +
    "131 :         this.$set(categorySchemaMap, 'description', [{ subLabel: description }])\n" +
    '132 :       }\n' +
    '133 :       for (const prop of props) {\n' +
    '            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^',
  plugin: 'buble',

my rollup settings:

const rollupPlugins = [
  commonjs(),
  nodeResolve({
    extensions: ['.js'],
    preferBuiltins: false,
  }),
  VuePlugin(),
  json(),
  buble({
    objectAssign: 'Object.assign',
  }),
]

I believe I sould perhaps pass some settings to buble rollup plugin, but not sure what.

Any help much appreciated!

kzc commented 4 years ago

[!] (plugin buble) CompileError: Transforming for-of statements is not fully supported. Use transforms: { forOf: false } to skip transformation and disable this error, or transforms: { dangerousForOf: true } if you know what you're doing.

mesqueeb commented 4 years ago

thanks a lot! I rewrote the for...of as a forEach and the problem went away!