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

2.17 - outputPaths vendor JS option triggers "Could not find module ember-resolver" error in browser #7518

Closed
GCheung55 opened this issue Dec 22, 2017 · 9 comments

Comments

@GCheung55
Copy link

With 2.17+, ember-resolver is not imported when outputPaths contains a vendor JS config option in ember-cli-build.js

let app = new EmberApp(defaults, {
  // Add options here
  outputPaths: {
    // app: {
    //    js: '/assets/scripts/my-app.js'
    // },
    vendor: {
      js: '/assets/scripts/vendor.js'
    }
  }
});

I have a demo of this happening in this repo: https://github.com/GCheung55/ember-upgrade-repo


Output from ember version --verbose && npm --version && yarn --version:

ember-cli: 2.17.1
http_parser: 2.7.0
node: 6.11.4
v8: 5.1.281.108
uv: 1.11.0
zlib: 1.2.11
ares: 1.10.1-DEV
icu: 58.2
modules: 48
openssl: 1.0.2l
os: darwin x64
3.10.10
1.3.2
@GCheung55 GCheung55 changed the title 2.17 - Could not find module ember-resolver imported from my-app/resolver 2.17 - outputPaths vendor JS option triggers "Could not find module ember-resolver" error in browser Dec 22, 2017
@rwjblue
Copy link
Member

rwjblue commented Dec 22, 2017

Thank you for reporting!

kevinansfield added a commit to TryGhost/Admin that referenced this issue Jan 3, 2018
no issue
- there's a [bug in ember-cli@2.17](ember-cli/ember-cli#7518) that results in production builds throwing an error: `Uncaught Error: Could not find module 'ember-resolver' imported from 'ghost-admin/resolver'`
@kevinansfield
Copy link

I ran into this too. Interestingly development builds were fine so it went undetected for quite a while, in our case it was only the production build that was throwing the ember-resolver error

@SergeAstapov
Copy link
Contributor

Ran into the same issue while upgrading Ember CLI from 2.16 to 2.18.
And we have customized outputPath for vendor.js file via outputPaths config option due to some restrictions in infrastructure.

Applying change from #7519 makes Ember CLI happy.

Is it possible to release as a patch for 2.18?

@twokul
Copy link
Contributor

twokul commented Feb 6, 2018

#7610

@twokul
Copy link
Contributor

twokul commented Feb 14, 2018

I believe this could be closed as v3.0.0 was released with the fix included.

@twokul twokul closed this as completed Feb 14, 2018
@gnapse
Copy link

gnapse commented Feb 15, 2018

But there should be a fix in the 2.x version range, don't you think?

Because right now v2.18.2 is effectively broken because of this.

@rohmann
Copy link

rohmann commented Mar 14, 2018

As @gnapse has pointed out this is still broken in 2.18.2. I'm working in a hybrid setup that runs an Ember Application inside of another project where we happen to have gulp available. This hack using gulp-replace helped me get things working again.

gulp.task('patch-ember', function() {
  return gulp.src(['node_modules/ember-cli/lib/broccoli/ember-app.js'])
    .pipe(replace('DEFAULT_CONFIG.outputPaths.vendor.js', function() {
      return "vendorFilePath";
    }))
    .pipe(gulp.dest('node_modules/ember-cli/lib/broccoli/'));
});

@avdv
Copy link
Contributor

avdv commented Feb 15, 2019

I believe this could be closed as v3.0.0 was released with the fix included.

@twokul do you mean that we should use ember-cli 3.0.0 with ember source / library at 2.18.x?

@givanse
Copy link

givanse commented Nov 18, 2020

@avdv I tried that combo and it didn't.

edit: going straight to 3 worked

    "ember-cli": "~3.0.4",
    "ember-source": "~3.0.0",

tip: use node 8

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

9 participants