-
Notifications
You must be signed in to change notification settings - Fork 69
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
FastBoot.require is broken when running locally #221
Comments
Isn't external module allowed to be Setting |
Yes, fix in that PR was about external modules for production like environment ( The error mentioned here showed up when upgrading to Ember CLI 3.5+, which now uses system
Agree, with
That's IMHO a possible quick fix too.
This comes from our experience with the if (typeof FastBoot !== undefined) {
return import('ldclient-node');
} else {
return import('ldclient-js');
} |
Yea seems it works with @bobisjan Is it failing for you locally when developing with Seems Also curious @ef4's opinion on this. |
No, it's failing with I'm not sure about linking |
@bobisjan what is your ember-data version? |
@xg-wang, The example you've linked is using |
This is zonkyio/ember-cli-fastboot@0853d8f how I temporarily solved the issue by installing FastBoot dependencies in |
The following error occurs with
ember-fetch
installed:The problem is that
resolve.sync
can not find module based on thebasedir
set todistPath
https://github.com/ember-fastboot/fastboot/blob/master/src/ember-app.js#L139.This does not occur in previous version (1.x), because of this fallback https://github.com/ember-fastboot/fastboot/blob/master/src/ember-app.js#L151, I assume that this works only by accident, because that branch was meant (based on the comment) only for Node.js internal modules like
path
,os
, ...The "production" usage with
fastboot-app-server
is not affected, because it requires to runnpm install
in "dist" directory (manually http://ember-fastboot.com/docs/deploying#deploying-your-app or automatically eq. when using S3 downloader https://github.com/ember-fastboot/fastboot-s3-downloader/blob/master/index.js#L110), hence theresolve.sync
works fine.Possible quick fixes
Remove the
basedir
option fromresolve.sync
call.or
Run
npm install
insidedistPath
after build fromember-cli-fastboot
add-on.Proper fix
Deprecate
FastBoot.require
for importing external modules (only internals are allowed likepath
,os
, ...) and useember-auto-import
add-on.What do you think? @kratiahuja, @rwjblue, @xg-wang
The text was updated successfully, but these errors were encountered: