Code Monkey home page Code Monkey logo

Comments (8)

xg-wang avatar xg-wang commented on July 16, 2024 1

I believe this issue can be closed.

If there's something missing here please reopen or create another issue.

from ember-fetch.

oscarni avatar oscarni commented on July 16, 2024

This happens to me when I resolve to fastboot 2.0.0 or above. Running Fastboot 1.2.1 works fine with ember-fetch 6.4.0. Maybe that could be the culprit?

from ember-fetch.

simonihmig avatar simonihmig commented on July 16, 2024

I also stumbled into this. Even with the latest release.

This happens to me when I resolve to fastboot 2.0.0 or above. Running Fastboot 1.2.1 works fine with ember-fetch 6.4.0

Weird. It is just the opposite for me, I was able to fix it by forcing [email protected] on my app server. (not trying this locally, but on the real staging server)

I dug into this, and I think the use of existsSync is the culprit, which does not know anything about node's module resulution: https://github.com/ember-fastboot/fastboot/blob/v1.2.1/src/ember-app.js#L126

nodeModulesPath is something like .../dist/abortcontroller-polyfill/dist/cjs-ponyfill, and that file indeed does not exist physically, as the .js file type is missing here. So it tries to require not from within the dist path, and that fails.

In the latest version of fastboot the resolve package is used, which correctly understands that this is a valid module reference: https://github.com/ember-fastboot/fastboot/blob/master/src/ember-app.js#L139

from ember-fetch.

xg-wang avatar xg-wang commented on July 16, 2024

I can confirm this happens on ember-cli-fastboot, not specific to your fork.
This happens when I do yarn link ember-cli-fastboot on a ember app.

I set a debugger at the line before node does require, then require.resolve('node-fetch') will error when link, but works well if not link.

It could be yarn link issue or ember-cli-fastboot issue which I don't know. [email protected] containing ember-fastboot/fastboot#200 is a good to have but it doesn't help with the link issue.

[I] ➜ ember --version --verbose
ember-cli: 3.6.1
http_parser: 2.8.0
node: 11.2.0
v8: 7.0.276.38-node.11
uv: 1.23.2
zlib: 1.2.11
ares: 1.15.0
modules: 67
nghttp2: 1.34.0
napi: 3
openssl: 1.1.0i
icu: 62.1
unicode: 11.0
cldr: 33.1
tz: 2018e
os: darwin x64

[I] ➜ yarn --version
1.12.3

from ember-fetch.

lucacorti avatar lucacorti commented on July 16, 2024

I'm still getting this with [email protected] in fastboot.

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 (dist/ember-fetch/fetch-fastboot-5e5d008c8b65b0ac116f7635d0c6c6b9.js:1:24)
    at a.exports (dist/assets/vendor-4de0f4d6c6a261773e0e61365d28c09b.js:19:21)
    at a._reify (dist/assets/vendor-4de0f4d6c6a261773e0e61365d28c09b.js:22:35)
    at a.reify (dist/assets/vendor-4de0f4d6c6a261773e0e61365d28c09b.js:21:23)
    at a.exports (dist/assets/vendor-4de0f4d6c6a261773e0e61365d28c09b.js:18:84)

from ember-fetch.

lucacorti avatar lucacorti commented on July 16, 2024

@xg-wang works for me

from ember-fetch.

devotox avatar devotox commented on July 16, 2024

I have found if you just install ember-fetch on the encapsulating server this works without the need to install all packages in the dist directory

from ember-fetch.

Brunoporto2702 avatar Brunoporto2702 commented on July 16, 2024

I believe this issue can be closed.

If there's something missing here please reopen or create another issue.

Do you know how to do that on a heroku server?

from ember-fetch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.