-
Notifications
You must be signed in to change notification settings - Fork 109
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
"Can't resolve 'videojs'" error when building for production #300
Comments
I have this working with the following ember-auto-import configuration.
If anyone has any insight into why this is not needed for a development build, I would be interested in hearing it. |
I think what's happening here is that something in videojs-youtube breaks if you transpile it with babel. It seems to break in such a way that webpack sees The reason it's different in production is probably this: If your app doesn't actually need to support IE11, you can take that out and then you won't have a problem in production. Or you can tell ember-auto-import not to transpile this particular library: let app = new EmberApp(defaults, {
autoImport: {
skipBabel: [
{
package: "videojs-youtube",
semverRange: "*",
},
],
},
}); The only downside of this is that if the authors of videojs-youtube use any new language features that don't work in all your supported browsers, they can break your app. That is why we allow the configuration rule to be limited to a particular semver range -- if you want to be careful you can set |
I filed a PR to address the issue in |
I have added the latest versions of Video.js and its YouTube plugin to an Ember 3.19 application.
It was working fine until I tried to do a production build (
ember build -e production
), when I get this error from ember-auto-import.I tried creating an empty Ember 3.19 application and adding nothing but these two modules, and a component to import them, and I get the same error. A complete error log is attached. One of the imports is "videojs", which the Ember application has no trouble finding.
If I just needed an alias, I would expect it to be needed for development and production. What is different about a production build that could cause this error?
Thanks.
error.dump.acd7611f90cfcf580dd9cb3ba76fbad7.log
The text was updated successfully, but these errors were encountered: