简体   繁体   中英

Ember build issue: "Cannot use the decorators and decorators-legacy plugin together"

I have recently encountered an issue with building my ember project with bitbucket pipelines:

+ ember build --environment="production"
Could not start watchman
Visit https://ember-cli.com/user-guide/#watchman for more info.
Building
Environment: production
cleaning up
cleaning up...
Build Error (broccoli-persistent-filter:Babel > [Babel: ember-data]) in ember-data/adapters/json-api.js
Cannot use the decorators and decorators-legacy plugin together

I am currently using ember-cli version 3.8.1.

The issue occurs with all build environments, not just production. What baffles me is that no new npm package or ember addon was added between last successful build and the ones that have been failing since - and now if I re-run the successful build, that will also fail.

I have gone back in the commit history to a commit that worked, then fast-forward into the present step-by-step - always deleting the node_modules and reinstalling the packages. It always works locally, but it will always fail when the pipeline is run.

I have also tried updating my docker image.

I have already gone through and tried the solutions listed here - but it seems like they have already been addressed in version 3.8.1.

Also, if it is any help, this is my bitbucket-pipelines.yml:

pipelines:
  branches:
    master:
      - step:
         name: Building Ember Project
         script:
          - npm install
          - npm install firebase-tools
          - ember build --environment="production"
      - step:
         trigger: manual
         deployment: production
         name: Deploy to Production
         script:
          - firebase use prod
          - firebase deploy --non-interactive --token ${FIREBASE_TOKEN}

Thank you all in advance!

This sounds like a sub-dependency changing on the fly under the hood. Do you have an npm or yarn lockfile commited as part of your repo? Lockfiles are specifically designed to keep from hitting snags like this

I have gone through the below errors,

Build error : “Cannot use the decorators and decorators-legacy plugin together”

Build error: 'relationshipStateFor' is not exported by -private\\system\\record-data-for.js

On browser got Expected store.createRecordDataFor to be implemented but it wasn't.

Reason for the above error is with ember-data addon and mismatch in ember-cli version installed for my project.

In your package.json , You might have defined ember-cli version( "ember-cli": "^3.11.0", ) with ^ symbol this means it will install latest version which is less than the 4.0.0. So your ember-cli in node_modules might be installed to the latest version.

The above mentioned error is caused by the ember-cli version which was installed and pointed to 3.15.0. So I have removed the ^ and updated "ember-cli": "3.11.0", and removed node_modules and did npm install that solves the above problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM