question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Preview types PR causes ember-auto-import CI to fail

See original GitHub issue

🐞 Describe the Bug

I’m deep on a rabbit hole to fix something in ember-auto-import and I’ve hit another unrelated CI breakage 😞 Essentially some of ember-auto-import’s (large) CI matrix is broken and I’ve tracked it down to the first commit in this PR: https://github.com/emberjs/ember.js/pull/20180 using git bisect:

➜  ember.js git:(6278a8b7c) git bisect bad
6278a8b7cfe55ef2b138ec7d1324bc5cc79544c3 is the first bad commit
commit 6278a8b7cfe55ef2b138ec7d1324bc5cc79544c3
Author: Chris Krycho <redacted@redacted.redacted>
Date:   Mon Aug 22 21:32:04 2022 -0600

I don’t understand the error or why adding types might cause this particular problem in this particular test but this is what it is complaining about:

message: |
    Build Error (broccoli-persistent-filter:Babel > [Babel: ember-source]) in @ember/-internals/bootstrap/index.js
    
    [BABEL]: Cannot find module '@babel/core'
    Require stack:
    - /tmp/tmp-[18](https://github.com/ef4/ember-auto-import/runs/8259214273?check_suite_focus=true#step:6:19)35QNd8rBD1GlmJ/node_modules/ember-source/node_modules/@babel/plugin-transform-block-scoping/lib/tdz.js
    - /tmp/tmp-1835QNd8rBD1GlmJ/node_modules/ember-source/node_modules/@babel/plugin-transform-block-scoping/lib/index.js
    - /home/runner/work/ember-auto-import/ember-auto-import/node_modules/@babel/core/lib/config/files/module-types.js
    - /home/runner/work/ember-auto-import/ember-auto-import/node_modules/@babel/core/lib/config/files/configuration.js

You can see the full CI error here

🔬 Minimal Reproduction

You can use the ember-auto-import CI suite to test this.

  • clone https://github.com/ef4/ember-auto-import
  • run npm i in the root folder
  • (maybe you need to run npm update ember-source-canary in the root folder, I’m not sure)
  • cd test-scenarios
  • run npm run test -- --filter canary-addon-dev-dep:
  • 💥 it breaks

I was able to run git bisect on ember.js for this by replacing the dependency line for ember-source-canary in test-scenarios/package.json for "ember-source-canary": "file:/Users/mansona/git/opensource/ember/ember.js", (i.e. my local check of ember.js). For some reason you still need to run npm i in the root folder of ember-auto-import if you’re going to do this

😕 Actual Behavior

I think it’s a runtime error since it’s being reported as a qunit error 🤔 which leads me to believe that something that should be transpiled isn’t getting transpiled

🤔 Expected Behavior

No errors, build or runtime 🤷

🌍 Environment

  • Ember: Canary (at time of writing)
  • Node.js/npm: Node: v14.16.0 npm: 8.3.0
  • OS: macOS and ubuntu (on CI)
  • Browser: N/A (just running ember test on command line)

➕ Additional Context

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ef4commented, Sep 13, 2022

Yes, we can close this issue.

The bug is probably in https://github.com/stefanpenner/node-fixturify-project, specifically in the package linking code that I added there.

1reaction
ef4commented, Sep 13, 2022

Incidentally, I see that ember-source depends on @babel/plugin-transform-block-scoping but fails to satisfy that package’s peerDep on @babel/core.

Most of the time that works by accident, because another package (ember-cli-babel) has its own dependency on @babel/core and npm decides to hoist @babel/core into a place where @babel/plugin-transform-block-scoping happens to be able to see it. But it’s pretty fragile! There is no path of declared dependencies that actually communicates to users or the package manager that to use ember-source you must have @babel/core.

(I don’t actually think somebody should rush into fixing that. Because I think ember-source should instead drop the @babel/plugin-transform-block-scoping dependency entirely. Because it shouldn’t be providing ES modules via treeForVendor where such manual shenanigans are required. Modules in treeForAddon would get that plugin automatically.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack Returned Errors to ember-auto-import - Questions
I have a problem build error like title of my topic, anyone can help me? here's my package.json devDependencies: { "@ember/jquery": "^0.5.2" ...
Read more >
Changelog - ember-bootstrap
An ember-cli addon for using Bootstrap in Ember.js applications.
Read more >
ember-qunit | Yarn - Package Manager
ember -qunit simplifies testing of Ember applications with QUnit by providing QUnit-specific wrappers around the helpers contained in ember-test-helpers.
Read more >
Changelog - Cypress Documentation
Component tests that fail now display a code frame of the source location of the error within the Cypress reporter. Addresses #21720. Bugfixes:...
Read more >
ember-auto-import - npm
Start using ember-auto-import in your project by running `npm i ... TypeScript icon, indicating that this package has built-in type ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found