Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

broccoliBuilderErrorStack … Can't resolve '../../test-waiters' #778

Open
muziejus opened this issue Apr 26, 2021 · 18 comments
Open

broccoliBuilderErrorStack … Can't resolve '../../test-waiters' #778

muziejus opened this issue Apr 26, 2021 · 18 comments

Comments

@muziejus
Copy link

muziejus commented Apr 26, 2021

I can't tell if this is related to this issue, but I thought I'd give embroider a try and I get a build failure on step 1 ("First make it work with no options. This is the mode that supports maximum backward compatibility."):

- broccoliBuilderErrorStack: ModuleNotFoundError: Module not found: Error: Can't resolve '../../test-waiters' in '$TMPDIR/embroider/6d8b07/node_modules/@ember/test-helpers/-internal/debug-info.js'

This is with Ember 3.23.1 and Embroider 0.40.0

@angelayanpan
Copy link
Collaborator

is anyone looking into this?

@ef4
Copy link
Contributor

ef4 commented Jan 5, 2022

@rwjblue mentioned an issue recently with the way that @ember/test-waiters tries to deduplicate itself not playing well with Embroider.

If you use something like yarn resolutions to force your app to have a single copy of @ember/test-waiters, does that workaround the problem?

@angelayanpan
Copy link
Collaborator

my addon doesn't have ember/test-waiters in package.json

from yarn.lock, I see there are ^3.0.0 and ^2.4.3

which version should my addon try to resolve to?

@angelayanpan
Copy link
Collaborator

angelayanpan commented Jan 5, 2022

yarn why @ember/test-waiters
yarn why v1.22.4
[1/4] 🤔  Why do we have the module "@ember/test-waiters"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "@ember/test-waiters@2.4.5"
info Reasons this module exists
   - "@linkedin#ember-cli-pemberly-tracking" depends on it
   - Hoisted from "@linkedin#ember-cli-pemberly-tracking#@ember#test-waiters"
info Disk size without dependencies: "232KB"
info Disk size with unique dependencies: "3.19MB"
info Disk size with transitive dependencies: "50.08MB"
info Number of shared dependencies: 175
=> Found "@ember/test-helpers#@ember/test-waiters@3.0.0"
info This module exists because "@ember#test-helpers" depends on it.
info Disk size without dependencies: "156KB"
info Disk size with unique dependencies: "1.18MB"
info Disk size with transitive dependencies: "46.15MB"
info Number of shared dependencies: 157

@nightire
Copy link

nightire commented Jan 6, 2022

@angelayanpan I can confirm to add a resolution entry in the root package.json will fix this issue:

"resolutions": {
  "@ember/test-waiters": "3.0.1"
}

@angelayanpan
Copy link
Collaborator

thanks! but this is not a permanent solution right?

@ef4
Copy link
Contributor

ef4 commented Jan 7, 2022

I think this is fixed by #1064

@angelayanpan
Copy link
Collaborator

when do you plan to release the above PR?

@bertdeblock
Copy link
Contributor

@angelayanpan
Copy link
Collaborator

angelayanpan commented Jan 11, 2022

ok, so I have pulled in
"@embroider/compat": "^0.50.0",
"@embroider/core": "^0.50.0",
"@embroider/test-setup": "^0.50.0",
"@embroider/webpack": "^0.50.0",

I still see "can't resolve test-waiters" in my project. I added the resolution back. and don't see that specific error anymore.

@ef4
Copy link
Contributor

ef4 commented Jan 11, 2022

Yes, the PR I mentioned above is released on 0.50. This issue may be a combination of people reporting two different problems that interact, and only one of them is fixed.

@angelayanpan is your stack trace still exactly the same as the ones above?

Is the place that's failing to find test-waiters using it via the old import path (ember-test-waiters) or the modern one (@ember/test-waiters)?

@angelayanpan
Copy link
Collaborator

angelayanpan commented Jan 11, 2022

no occurances of "ember-test-waiters" in our project when I did a search.
my errors look like this:

ERROR in ../../node_modules/@ember/test-helpers/-internal/debug-info.js 17:0-60
Module not found: Error: Can't resolve '@ember/test-waiters' in '$TMPDIR/embroider/dedea7/node_modules/@ember/test-helpers/-internal'
 @ ./assets/test.js 52:9-82

ERROR in ../../node_modules/@ember/test-helpers/settled.js 4:0-56
Module not found: Error: Can't resolve '@ember/test-waiters' in '$TMPDIR/embroider/dedea7/node_modules/@ember/test-helpers'
 @ ./assets/test.js 181:9-69
 
 ERROR in ../../node_modules/@linkedin/ember-cli-pemberly-tracking/modifiers/render-performance.js 62:0-50
Module not found: Error: Can't resolve '@ember/test-waiters' in '$TMPDIR/embroider/dedea7/node_modules/@linkedin/ember-cli-pemberly-tracking/modifiers'
 @ ./assets/dummy.js 4219:9-108

ERROR in ../../node_modules/ember-a11y-testing/test-support/audit.js 5:0-53
Module not found: Error: Can't resolve '@ember/test-waiters' in '$TMPDIR/embroider/dedea7/node_modules/ember-a11y-testing/test-support'
 @ ./assets/test.js 232:9-79

ERROR in ./assets/dummy.js 4123:9-125
Module not found: Error: Can't resolve '../../../node_modules/@linkedin/ember-cli-pemberly-tracking/node_modules/@ember/test-waiters/build-waiter' in '$TMPDIR/embroider/dedea7/tests/dummy/assets'

and more.... (21 errors in total)

@rwjblue
Copy link
Collaborator

rwjblue commented Jan 11, 2022

@angelayanpan - This is after updating to @embroider/* 0.50.0?

@angelayanpan
Copy link
Collaborator

yes @rwjblue

@roomman
Copy link

roomman commented Jan 18, 2022

Similar situation here. Added @ember/test-waiters to a project with @embroider/* 0.50.2 and getting the following:

ERROR Summary:

  - broccoliBuilderErrorStack: ModuleNotFoundError: Module not found: Error: Can't resolve '@ember/test-waiters' in '/private/var/folders/cp/mp10cjhd1xdf8wg5gk7s9g500000gn/T/embroider/b26e50/authenticators'
    at /Users/simon/Sites/oneday-academy-ui/node_modules/webpack/lib/Compilation.js:2011:28
    at /Users/simon/Sites/oneday-academy-ui/node_modules/webpack/lib/NormalModuleFactory.js:795:13
    at eval (eval at create (/Users/simon/Sites/oneday-academy-ui/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:10:1)
    at /Users/simon/Sites/oneday-academy-ui/node_modules/webpack/lib/NormalModuleFactory.js:275:22
    at eval (eval at create (/Users/simon/Sites/oneday-academy-ui/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
    at /Users/simon/Sites/oneday-academy-ui/node_modules/webpack/lib/NormalModuleFactory.js:431:22
    at /Users/simon/Sites/oneday-academy-ui/node_modules/webpack/lib/NormalModuleFactory.js:124:11
    at /Users/simon/Sites/oneday-academy-ui/node_modules/webpack/lib/NormalModuleFactory.js:667:25
    at /Users/simon/Sites/oneday-academy-ui/node_modules/webpack/lib/NormalModuleFactory.js:852:8
    at /Users/simon/Sites/oneday-academy-ui/node_modules/webpack/lib/NormalModuleFactory.js:972:5
    at /Users/simon/Sites/oneday-academy-ui/node_modules/neo-async/async.js:6883:13
    at /Users/simon/Sites/oneday-academy-ui/node_modules/webpack/lib/NormalModuleFactory.js:955:45
    at finishWithoutResolve (/Users/simon/Sites/oneday-academy-ui/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:296:11)
    at /Users/simon/Sites/oneday-academy-ui/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:362:15
    at /Users/simon/Sites/oneday-academy-ui/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:410:5
    at eval (eval at create (/Users/simon/Sites/oneday-academy-ui/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
  - code: [undefined]
  - codeFrame: Module not found: Error: Can't resolve '@ember/test-waiters' in '$TMPDIR/embroider/b26e50/authenticators/oneday-firebase.js'
  - errorMessage: authenticators/oneday-firebase.js: Module not found: Error: Can't resolve '@ember/test-waiters' in '$TMPDIR/embroider/b26e50/authenticators/oneday-firebase.js'
        at PackagerRunner (@embroider/webpack)
  - errorType: Build Error
  - location:
    - column: [undefined]
    - file: authenticators/oneday-firebase.js
    - line: [null]
    - treeDir: [undefined]
  - message: authenticators/oneday-firebase.js: Module not found: Error: Can't resolve '@ember/test-waiters' in '$TMPDIR/embroider/b26e50/authenticators/oneday-firebase.js'
        at PackagerRunner (@embroider/webpack)
  - name: Error
  - nodeAnnotation: @embroider/webpack
  - nodeName: PackagerRunner
  - originalErrorMessage: Module not found: Error: Can't resolve '@ember/test-waiters' in '$TMPDIR/embroider/b26e50/authenticators/oneday-firebase.js'
  - stack: ModuleNotFoundError: Module not found: Error: Can't resolve '@ember/test-waiters' in '/private/var/folders/cp/mp10cjhd1xdf8wg5gk7s9g500000gn/T/embroider/b26e50/authenticators'
    at /Users/simon/Sites/oneday-academy-ui/node_modules/webpack/lib/Compilation.js:2011:28
    at /Users/simon/Sites/oneday-academy-ui/node_modules/webpack/lib/NormalModuleFactory.js:795:13
    at eval (eval at create (/Users/simon/Sites/oneday-academy-ui/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:10:1)
    at /Users/simon/Sites/oneday-academy-ui/node_modules/webpack/lib/NormalModuleFactory.js:275:22
    at eval (eval at create (/Users/simon/Sites/oneday-academy-ui/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
    at /Users/simon/Sites/oneday-academy-ui/node_modules/webpack/lib/NormalModuleFactory.js:431:22
    at /Users/simon/Sites/oneday-academy-ui/node_modules/webpack/lib/NormalModuleFactory.js:124:11
    at /Users/simon/Sites/oneday-academy-ui/node_modules/webpack/lib/NormalModuleFactory.js:667:25
    at /Users/simon/Sites/oneday-academy-ui/node_modules/webpack/lib/NormalModuleFactory.js:852:8
    at /Users/simon/Sites/oneday-academy-ui/node_modules/webpack/lib/NormalModuleFactory.js:972:5
    at /Users/simon/Sites/oneday-academy-ui/node_modules/neo-async/async.js:6883:13
    at /Users/simon/Sites/oneday-academy-ui/node_modules/webpack/lib/NormalModuleFactory.js:955:45
    at finishWithoutResolve (/Users/simon/Sites/oneday-academy-ui/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:296:11)
    at /Users/simon/Sites/oneday-academy-ui/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:362:15
    at /Users/simon/Sites/oneday-academy-ui/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:410:5
    at eval (eval at create (/Users/simon/Sites/oneday-academy-ui/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)

=================================================================================

The import statement is import { waitFor } from '@ember/test-waiters'. There are no references to ember-test-waiters in the project.

@angelayanpan
Copy link
Collaborator

you probably need add to the resolutions mentioned above.

@roomman
Copy link

roomman commented Jan 18, 2022

Thanks @angelayanpan but this particular project doesn't use Yarn so that's not an option, unless I've missed some recent NPM feature releases?

Edit: so it looks like I did miss something and "overrides" were added to NPM in 8.3.0. Will give that a try now 👍🏻

Edit: added an npm override to my package.json but it did not fix the issue for my project.

@vfuto
Copy link

vfuto commented Jul 11, 2022

@roomman I had the same issue, build failed with adding "@ember/test-waiters": "3.0.1" in resolutions, but after cleaning node_modules (also deleted the build from $TMPDIR/embroider) and running yarn install fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants