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

Issue with fastboot after upgrading to ember 3.9 #686

Closed
lucacorti opened this issue Apr 13, 2019 · 17 comments · Fixed by #709
Closed

Issue with fastboot after upgrading to ember 3.9 #686

lucacorti opened this issue Apr 13, 2019 · 17 comments · Fixed by #709

Comments

@lucacorti
Copy link
Contributor

lucacorti commented Apr 13, 2019

I'm getting this error from fastboot while running in production (fastboot-app-server), this does not happen in local development:

Error: Cannot find module 'abortcontroller-polyfill/dist/cjs-ponyfill'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
    at Function.Module._load (internal/modules/cjs/loader.js:508:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.require (node_modules/fastboot/src/ember-app.js:130:18)
    at a.callback (ember-fetch/fetch-fastboot-5e5d008c8b65b0ac116f7635d0c6c6b9.js:1:24)
    at a.exports (assets/vendor-21774982fde9f3d01e619c23b73298da.js:19:21)
    at a._reify (assets/vendor-21774982fde9f3d01e619c23b73298da.js:22:35)
    at a.reify (assets/vendor-21774982fde9f3d01e619c23b73298da.js:21:23)
    at a.exports (assets/vendor-21774982fde9f3d01e619c23b73298da.js:18:84)
@lucacorti lucacorti changed the title Issue with fastboot after upgrading to ember 3.9 (not the fetch issue) Issue with fastboot after upgrading to ember 3.9 Apr 13, 2019
@lucacorti
Copy link
Contributor Author

Looks related to ember-cli/ember-fetch#184

@kiwiupover
Copy link
Member

kiwiupover commented Apr 13, 2019 via email

@lucacorti
Copy link
Contributor Author

@kiwiupover I'm having the same issue with 3.9.1

@igorT
Copy link

igorT commented Apr 22, 2019

@kiwiupover This seems slightly different from the ED 3.9.0 issue, but still like it's coming from fetch?

@kiwiupover
Copy link
Member

@lucacorti add ember-fetch to your app.

ember install ember-fetch

@lucacorti
Copy link
Contributor Author

@kiwiupover I have ember-fetch as a devDependency in my package.json

@rwjblue
Copy link
Member

rwjblue commented Apr 22, 2019

Can you provide a reproduction repo? It would help in debugging...

@lucacorti
Copy link
Contributor Author

@rwjblue I'm having issues reproducing this in a brand new project.

The issue manifests itself only for my project and only in fastboot-app-server on Linux, not when running with ember s locally on macOS. A brand new project with ember new from ember-cli@3.9.0 does not exhibit the same behavior in fastboot-app-server.

I guess this is triggered by something else in my project, probably some other dependency.

@rwjblue
Copy link
Member

rwjblue commented Apr 24, 2019

@xg-wang - I recall this error, but not the specific resolution. Do you happen to remember?

@xg-wang
Copy link
Member

xg-wang commented Apr 24, 2019

@rwjblue Are you saying this issue ember-cli/ember-fetch#115?
@lucacorti Have you installed node_modules within fastboot-app-server? I'm asking because if not this error will occur ember-fastboot/fastboot#200 (comment).

@lucacorti
Copy link
Contributor Author

@xg-wang Just to check if I'm getting this right, am I supposed to run yarn or npm install in the dist directory which contains the build of my application?

I do install fastboot-app-server in a different folder with its own deps already and everything used to work. Is this only needed for ember-fetch?

@xg-wang
Copy link
Member

xg-wang commented Apr 24, 2019

@lucacorti Yes you should run yarn or npm install in dist. This is not well documented (@kratiahuja can you confirm?) and applies to all addons that support fastboot and require extra dependencies.
I guess your issue looks exactly the same as my repro ember-cli/ember-fetch#115 (comment)

@lucacorti
Copy link
Contributor Author

lucacorti commented Apr 24, 2019

@xg-wang yes the issue looks exactely like mine, but after running yarn in dist, and having depdendencies in dist/node_modules (including abortcontroller-polyfill) I have exactly the same error with fastboot.

@lucacorti
Copy link
Contributor Author

@xg-wang @rwjblue I just noticed fastboot-app-server depends on fastboot 1.x while ember-cli-fastboot is using fastboot 2.x. Not sure if this helps, but some fix for this is mentioned in the changelog for fastboot 2.0.0 (ember-fastboot/fastboot#200) so I guess fastboot-app-server might need a fastboot bump?

@lucacorti
Copy link
Contributor Author

lucacorti commented May 6, 2019

I submitted a PR to fastboot-app-server bumping fastboot to 2.0.0 and fastboot-express-middleware to 1.2.0. This solves the issue for me.

@arschmitz
Copy link

After updating my app to fastboot 2.x im running into this as well

@lucacorti
Copy link
Contributor Author

lucacorti commented Jul 15, 2019

FastbootAppServer 2.0.0 is out with ember-fastboot/fastboot-app-server#102 merged. I tested this in production and everything works as expected, so I'm closing this.

Thanks to everyone for the help.

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

Successfully merging a pull request may close this issue.

6 participants