Ember.js: New app broken after being created by ember-cli 3.10.1

Created on 4 Jul 2019  ·  7Comments  ·  Source: emberjs/ember.js

Both myself and my colleague have created brand new apps using ember-cli 3.10.1 and in both our cases the app fails to boot with the following error:

image

Steps to reproduce:

  1. npx ember-cli new test-app (I also tried by installing yarn globally and doing ember new test-app)
  2. cd test-app
  3. ember s
  4. Load the app in http://localhost:4200

What I expect:

The welcome page loads

What happens:

The app crashes with the exception.

index.js:163 Uncaught Error: Assertion Failed: Expected hash or Mixin instance, got [object Undefined]
    at assert (index.js:163)
    at buildMixinsArray (metal.js:4645)
    at Mixin.reopen (metal.js:4574)
    at Function.extend (core_object.js:575)
    at Module.callback (rest.js:274)
    at Module.exports (loader.js:106)
    at Module._reify (loader.js:143)
    at Module.reify (loader.js:130)
    at Module.exports (loader.js:104)
    at Module._reify (loader.js:143)

Details

➜  hacking ember -v
ember-cli: 3.10.1
node: 10.15.0
os: darwin x64

I have a sample repo here https://github.com/patocallaghan/new-test-app

Most helpful comment

If anyone is seeing this and wants to fix it temporarily you can:

  • delete your package-lock.json
  • run npm i --before 2019-07-03

you need to be using [email protected] or later to make use of the time-travel install feature so if that doesn't work you can run npm i -g npm@latest and that will get you up to the latest 👍

All 7 comments

Hey @patocallaghan thanks for the report 🎉

It looks like this is a regression from @babel/[email protected] which might be related to https://github.com/babel/babel/issues/10162 which seems like it might have something to do with the use of TypeScript

Essentially it seems that the output for ember-data is empty 🙈 I don't know if this is isolated to TypeScript because I don't know if ember-data is currently using TypeScript under the hood or not

If anyone is seeing this and wants to fix it temporarily you can:

  • delete your package-lock.json
  • run npm i --before 2019-07-03

you need to be using [email protected] or later to make use of the time-travel install feature so if that doesn't work you can run npm i -g npm@latest and that will get you up to the latest 👍

Running npm i --before 2019-07-03 fixed it for us. :tada:
For anyone running into the same issue, during the build we always got the message generated an empty bundle, then when loading the project we got the same error as reported by @patocallaghan.

[email protected] was just released which should fix this issue for now, by pinning the broken dependency to a version that works.

This hasn’t fixed it.
I deleted my yarn.lock and did a fresh install but I still have the same error message.

diff --git a/yarn.lock b/yarn.lock
index 058eb2d..aee4ea9 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -616,7 +616,7 @@
   dependencies:
     "@babel/helper-plugin-utils" "^7.0.0"

-"@babel/plugin-transform-typescript@^7.1.0", "@babel/plugin-transform-typescript@^7.3.2":
+"@babel/plugin-transform-typescript@^7.3.2":
   version "7.5.0"
   resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.5.0.tgz#a0855287eec87fe83c11e8dad67d431d343b53b1"
   integrity sha512-z3T4P70XJFUAHzLtEsmJ37BGVDj+55/KX8W8TBSBF0qk0KLazw8xlwVcRHacxNPgprzTdI4QWW+2eS6bTkQbCA==
@@ -625,6 +625,14 @@
     "@babel/helper-plugin-utils" "^7.0.0"
     "@babel/plugin-syntax-typescript" "^7.2.0"

+"@babel/plugin-transform-typescript@~7.4.0":
+  version "7.4.5"
+  resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.4.5.tgz#ab3351ba35307b79981993536c93ff8be050ba28"
+  integrity sha512-RPB/YeGr4ZrFKNwfuQRlMf2lxoCUaU01MTw39/OFE/RiL8HDjtn68BwEPft1P7JN4akyEmjGWAMNldOV7o9V2g==
+  dependencies:
+    "@babel/helper-plugin-utils" "^7.0.0"
+    "@babel/plugin-syntax-typescript" "^7.2.0"
+
 "@babel/plugin-transform-unicode-regex@^7.4.4":
   version "7.4.4"
   resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.4.4.tgz#ab4634bb4f14d36728bf5978322b35587787970f"
@@ -5381,12 +5389,12 @@ ember-cli-test-loader@^2.2.0:
     ember-cli-babel "^6.8.1"

 ember-cli-typescript@^2.0.0:
-  version "2.0.1"
-  resolved "https://registry.yarnpkg.com/ember-cli-typescript/-/ember-cli-typescript-2.0.1.tgz#9c46729213b9e1d13f5c3ff8421d772134aa889e"
-  integrity sha512-xwSEQOUNM621Wt+XJWpbLhBIeqC/dM1lDS+oZQ2nSjxp4MLZkpKuiVBqdbBWcURbvv8ghoVQPfy8wYU4JIFkLA==
+  version "2.0.2"
+  resolved "https://registry.yarnpkg.com/ember-cli-typescript/-/ember-cli-typescript-2.0.2.tgz#464984131fbdc05655eb61d1c3cdd911d3137f0d"
+  integrity sha512-7I5azCTxOgRDN8aSSnJZIKSqr+MGnT+jLTUbBYqF8wu6ojs2DUnTePxUcQMcvNh3Q3B1ySv7Q/uZFSjdU9gSjA==
   dependencies:
     "@babel/plugin-proposal-class-properties" "^7.1.0"
-    "@babel/plugin-transform-typescript" "^7.1.0"
+    "@babel/plugin-transform-typescript" "~7.4.0"
     ansi-to-html "^0.6.6"
     debug "^4.0.0"
     ember-cli-babel-plugin-helpers "^1.0.0"

it looks like you have another copy of @babel/plugin-transform-typescript from somewhere else that might be the problem

Thanks, pinning the version in my app fixed it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Yelinz picture Yelinz  ·  47Comments

matheusdavidson picture matheusdavidson  ·  37Comments

ctataryn picture ctataryn  ·  33Comments

marcoow picture marcoow  ·  59Comments

workmanw picture workmanw  ·  79Comments