embroider-build / embroider

Compiling Ember apps into spec-compliant, modern Javascript.
MIT License
339 stars 137 forks source link

'loose' mode configuration must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled). #1037

Closed NullVoxPopuli closed 2 years ago

NullVoxPopuli commented 2 years ago

This is a weird one -- potentially also related to https://github.com/babel/ember-cli-babel/issues/419

Found: https://github.com/NullVoxPopuli/ember-statechart-component/runs/4422910549?check_suite_focus=true#step:5:40

ERROR in ./assets/dummy.js
Module build failed (from ../../../../../home/runner/work/ember-statechart-component/ember-statechart-component/node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 0)
$TMPDIR/embroider/41c7ff/tests/dummy/assets/dummy.js: 'loose' mode configuration must be the same for @babel/plugin-proposal-class-properties, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-private-property-in-object (when they are enabled).

    at enableFeature (/home/runner/work/ember-statechart-component/ember-statechart-component/node_modules/@babel/helper-create-class-features-plugin/lib/features.js:51:13)
    at PluginPass.pre (/home/runner/work/ember-statechart-component/ember-statechart-component/node_modules/@babel/helper-create-class-features-plugin/lib/index.js:78:35)
    at transformFile (/home/runner/work/ember-statechart-component/ember-statechart-component/node_modules/@babel/core/lib/transformation/index.js:94:27)
    at transformFile.next (<anonymous>)
    at run (/home/runner/work/ember-statechart-component/ember-statechart-component/node_modules/@babel/core/lib/transformation/index.js:33:12)
    at run.next (<anonymous>)
    at Function.transform (/home/runner/work/ember-statechart-component/ember-statechart-component/node_modules/@babel/core/lib/transform.js:25:41)
    at transform.next (<anonymous>)
    at step (/home/runner/work/ember-statechart-component/ember-statechart-component/node_modules/gensync/index.js:261:32)
    at /home/runner/work/ember-statechart-component/ember-statechart-component/node_modules/gensync/index.js:273:13

What's weird about this error, is that this addon isn't doing anything with private methods.... so... babel is continuing to confuse me and it's compounding. Is babel even a good idea? lol

NullVoxPopuli commented 2 years ago

doh! nevermind. I forgot my ember-cli-build.js had this:

  let app = new EmberAddon(defaults, {
    babel: {
      loose: true,
      plugins: [
        // ['@babel/plugin-proposal-private-property-in-object', { loose: true }],
        ['@babel/plugin-proposal-private-methods', { loose: true }],
      ],
    },
  });

while I was trying to find a work-around for: https://github.com/babel/ember-cli-babel/issues/419

removing all that config fixes this issue