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

[Bug] Could not find module ember-testing imported from @ember/test/index on ember 3.27.0 #19538

Closed
sinankeskin opened this issue May 8, 2021 · 7 comments · Fixed by #19540
Closed

Comments

@sinankeskin
Copy link

sinankeskin commented May 8, 2021

🐞 Describe the Bug

Updating ember app to v3.27.0 causing an error: Could not find module ember-testing imported from @ember/test/index

🔬 Minimal Reproduction

Create an app with latest ember-cli. Update ember-source to v3.27.0
Build the app with npm run build. Go to dist folder. Serve the folder. In my case, I'm using python -m "http.server"
You'll see the error message as: Uncaught Error: Could not find module ember-testing imported from @ember/test/index

I'm seeing the same error with my production app.

Here is the sample repo.

😕 Actual Behavior

App successfully built but when I run and reach to main route I'm seeing this error and app doesn't work.

🤔 Expected Behavior

App should be working.

🌍 Environment

  • Ember: - 3.26.1
  • Node.js/npm: - v14.16.1/7.6.3
  • OS: - Windows 10
  • Browser: - Microsoft Edge 90.0.818.51 x64

➕ Additional Context

Add any other context about the problem here.

@kpfefferle
Copy link
Sponsor Contributor

We are also seeing this error when we try to run our production app builds.

@runspired
Copy link
Contributor

We also hit this in production with EmberData. Removing all usage of registerWaiter and unregisterWaiter fixes production builds.

I think the issue is this import is likely dropped from production builds since it is only used for test builds. This went unnoticed when it was transpiled into Ember.registerWaiter because typically usage of it is wrapped in an if (DEBUG) {} but now that it's an import the import is missing.

cc @rwjblue @igorT @ef4

A failed app boot due to this can be seen in the relationship-performance check suite here: emberjs/data#7520

Failed check: https://github.com/emberjs/data/pull/7520/checks?check_run_id=2551009597

@runspired
Copy link
Contributor

cc @Turbo87 I'm fairly sure this is what you hit in crates

@elwayman02
Copy link
Contributor

embroider-build/embroider#805 seems to be related as well. I encountered the exact same error on Ember 3.26, but when upgrading @embroider/test-setup instead.

@runspired
Copy link
Contributor

runspired commented May 12, 2021

@elwayman02 most of the embroider ones are due to a bad fix in ember-cli-babel for ember-polyfills/ember-cached-decorator-polyfill#70 but yeah, this one might be this issue.

@pzuraq
Copy link
Contributor

pzuraq commented May 14, 2021

This should be fixed in 3.27.1, let us know if there are any issues!

@sinankeskin
Copy link
Author

I confirm, this issue fixed with 3.27.1

Thanks a lot.

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

Successfully merging a pull request may close this issue.

6 participants