簡體   English   中英

Ember 構建問題:“不能同時使用裝飾器和裝飾器遺留插件”

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

我最近在使用 bitbucket 管道構建我的 ember 項目時遇到了一個問題:

+ 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

我目前使用 ember-cli 版本 3.8.1。

所有構建環境都會出現此問題,而不僅僅是生產環境。 令我感到困惑的是,在上次成功構建和此后失敗的構建之間沒有添加新的 npm 包或 ember 插件 - 現在如果我重新運行成功的構建,那也將失敗。

我已經在提交歷史中返回到一個有效的提交,然后快進到當前的一步一步 - 總是刪除 node_modules 並重新安裝包。 它總是在本地工作,但在管道運行時總是會失敗。

我也嘗試過更新我的 docker 鏡像。

我已經通過並嘗試了 此處列出的解決方案 - 但似乎它們已經在 3.8.1 版中得到解決。

另外,如果有任何幫助,這是我的 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}

謝謝大家!

這聽起來像是引擎蓋下動態變化的子依賴關系。 你有一個 npm 或 yarn lockfile 作為你的 repo 的一部分提交嗎? Lockfiles 是專門設計用來防止碰到這樣的障礙的

我經歷了以下錯誤,

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

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

在瀏覽器上實現了Expected store.createRecordDataFor to be implemented but it wasn't.

上述錯誤的原因是 ember-data 插件和為我的項目安裝的 ember-cli 版本不匹配。

在你的package.json ,你可能已經用^符號定義了 ember-cli version( "ember-cli": "^3.11.0", ) 這意味着它將安裝低於 4.0.0 的最新版本。 因此,您在 node_modules 中的 ember-cli 可能已安裝到最新版本。

上述錯誤是由安裝並指向3.15.0的ember-cli版本引起的。 所以我刪除了^並更新了"ember-cli": "3.11.0",並刪除了 node_modules 並做了npm install解決了上述問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM