meteor-desktop icon indicating copy to clipboard operation
meteor-desktop copied to clipboard

Babel Error: api.caller is not a function - while trying to install 3.2.0

Open vbgm opened this issue 1 year ago • 15 comments

Describe the bug When trying to install as per Quck Start, getting an error:

at /Users/***/dev/test-meteor-complete/node_modules/@babel/preset-env/src/index.ts:390:13: api.caller is not a function
   at /Users/***/dev/test-meteor-complete/node_modules/@babel/preset-env/src/index.ts:390:13
   at /Users/***/dev/test-meteor-complete/node_modules/@babel/helper-plugin-utils/src/index.ts:62:12
   at packages/meteor-desktop-bundler/bundler.js:815:28
   at Function.time
   (/Users/***/.meteor/packages/meteor-tool/.2.14.0.963agd.102mc++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/tools/tool-env/tools/tool-env/profile.ts:284:30)
   at MeteorDesktopBundler.processFilesForTarget (packages/meteor-desktop-bundler/bundler.js:499:17)

To Reproduce

  1. Have following packages installed:
  "dependencies": {
    "@babel/runtime": "^7.23.5",
    "less": "^4.2.0",
    "meteor-node-stubs": "^1.2.7",
    "vue": "^3.4.7",
    "vue-meteor-tracker": "^3.0.0-beta.7",
    "vue-router": "^4.2.5"
  },
  "devDependencies": {
    "@meteor-community/meteor-desktop": "^3.2.0",
    "electron": "17.4.11",
    "electron-builder": "24.6.4"
  }
  1. Run command: meteor --mobile-server=127.0.0.1:3000 OR npm run desktop

  2. Observe the errors related to @babel api.call

Versions:

  • Meteor version: 2.14
  • Package version: 3.2.0

Additional context

Tried multiple times to reset meteor (deleting .meteor/local folder as well as delete node_modules on multiple steps), tried to add @babel/preset-env and @babel/core - still no luck.

vbgm avatar Jan 11 '24 02:01 vbgm

Thank you for submitting this issue!

We, the Members of Meteor Community Packages take every issue seriously. Our goal is to provide long-term lifecycles for packages and keep up with the newest changes in Meteor and the overall NodeJs/JavaScript ecosystem.

However, we contribute to these packages mostly in our free time. Therefore, we can't guarantee your issues to be solved within certain time.

If you think this issue is trivial to solve, don't hesitate to submit a pull request, too! We will accompany you in the process with reviews and hints on how to get development set up.

Please also consider sponsoring the maintainers of the package. If you don't know who is currently maintaining this package, just leave a comment and we'll let you know

github-actions[bot] avatar Jan 11 '24 02:01 github-actions[bot]

npm run desktop result:

ERROR  electronApp:  error while transpiling or minifying:  TypeError: api.caller is not a function
    at builder (/Users/***/dev/test-meteor-complete/node_modules/@babel/preset-env/src/index.ts:390:13)
    at /Users/***/dev/test-meteor-complete/node_modules/@babel/helper-plugin-utils/src/index.ts:62:12
    at ElectronApp.transpileAndMinify (/Users/***/dev/test-meteor-complete/node_modules/@meteor-community/meteor-desktop/lib/electronApp.js:854:33)
    at ElectronApp.build (/Users/***/dev/test-meteor-complete/node_modules/@meteor-community/meteor-desktop/lib/electronApp.js:451:24)
    at MeteorDesktop.run (/Users/***/dev/test-meteor-complete/node_modules/@meteor-community/meteor-desktop/lib/index.js:123:9)
INFO  electronApp:  packing .desktop to asar
VERBOSE  electronApp:  clearing temporary .desktop
INFO  meteorApp:  checking for any mobile platform
INFO  meteorApp:  building meteor app
DEBUG  meteorApp:  clearing build dir
INFO  meteorApp:  acquiring index.html
ERROR  meteorApp:  error while trying to download index.html for web.cordova, be sure that you are running a mobile target or with --mobile-server:  TypeError: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type boolean (false)
    at Object.writeFileSync (node:fs:2362:5)
    at MeteorApp.copyBuild (/Users/***/dev/test-meteor-complete/node_modules/@meteor-community/meteor-desktop/lib/meteorApp.js:657:20)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at MeteorApp.build (/Users/***/dev/test-meteor-complete/node_modules/@meteor-community/meteor-desktop/lib/meteorApp.js:856:17)
    at ElectronApp.getMeteorClientBuild (/Users/***/dev/test-meteor-complete/node_modules/@meteor-community/meteor-desktop/lib/electronApp.js:553:9)
    at ElectronApp.build (/Users/***/dev/test-meteor-complete/node_modules/@meteor-community/meteor-desktop/lib/electronApp.js:464:13)
    at MeteorDesktop.run (/Users/***/dev/test-meteor-complete/node_modules/@meteor-community/meteor-desktop/lib/index.js:123:9) {
  code: 'ERR_INVALID_ARG_TYPE'

vbgm avatar Jan 11 '24 02:01 vbgm

A clean repo to try to install to is here: https://github.com/vbgm/meteor-vue3-less

vbgm avatar Jan 11 '24 02:01 vbgm

"@meteor-community/meteor-desktop": "^3.1.1" seem to be working, but hot code push seem to be struggling..

vbgm avatar Jan 11 '24 05:01 vbgm

I’m having the same error indeed every time I build a new version of my app. However, the build continues and I’m not sure what consequences this error has for my app.This wasn’t showing up in running the test cases AFAIK.Would downgrading Babel solve it temporarily?On 11 Jan 2024, at 10:37, Victor Blagomir @.> wrote: npm run desktop result: ERROR electronApp: error while transpiling or minifying: TypeError: api.caller is not a function at builder @./preset-env/src/index.ts:390:13) at @./helper-plugin-utils/src/index.ts:62:12 at ElectronApp.transpileAndMinify @./meteor-desktop/lib/electronApp.js:854:33) at ElectronApp.build @./meteor-desktop/lib/electronApp.js:451:24) at MeteorDesktop.run @./meteor-desktop/lib/index.js:123:9) INFO electronApp: packing .desktop to asar VERBOSE electronApp: clearing temporary .desktop INFO meteorApp: checking for any mobile platform INFO meteorApp: building meteor app DEBUG meteorApp: clearing build dir INFO meteorApp: acquiring index.html ERROR meteorApp: error while trying to download index.html for web.cordova, be sure that you are running a mobile target or with --mobile-server: TypeError: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type boolean (false) at Object.writeFileSync (node:fs:2362:5) at MeteorApp.copyBuild @./meteor-desktop/lib/meteorApp.js:657:20) at processTicksAndRejections (node:internal/process/task_queues:95:5) at MeteorApp.build @./meteor-desktop/lib/meteorApp.js:856:17) at ElectronApp.getMeteorClientBuild @./meteor-desktop/lib/electronApp.js:553:9) at ElectronApp.build @./meteor-desktop/lib/electronApp.js:464:13) at MeteorDesktop.run @.***/meteor-desktop/lib/index.js:123:9) { code: 'ERR_INVALID_ARG_TYPE'

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

a4xrbj1 avatar Jan 11 '24 06:01 a4xrbj1

Has anyone been able to find a solution to this yet?

I am also trying to upgrade after having issues with 3.1.0 that (I assume due to babel/present-env) was converting js classes into functions and breaking when class inheritance was used. Not sure how much related to this issue with preset-env is.

Edit: Looks like my issue is probably coming from the Cordova build itself not having pure js classes. Still, would be nice to get updated Meteor Desktop to get higher Electron/Chrome versions.

MatejJan avatar Apr 04 '24 13:04 MatejJan

Getting the same with 3.2 and a different kind of error with 3.1 - but excited to see this is working! I just updated Color Schemer to 2.16 and it was running at least for development.

Does anyone know what the last working versions of Meteor x Meteor-Desktop were?

msavin avatar Jun 19 '24 18:06 msavin

Getting the same with 3.2 and a different kind of error with 3.1 - but excited to see this is working! I just updated Color Schemer to 2.16 and it was running at least for development.

Does anyone know what the last working versions of Meteor x Meteor-Desktop were?

3.2 works fine for me with Meteor 2.16. I haven’t tested it on 3.0x RC? yet.

a4xrbj1 avatar Jun 19 '24 18:06 a4xrbj1

@a4xrbj1 nice, and you are able to build a Mac app?

So far, I am able to run but not build

msavin avatar Jun 19 '24 19:06 msavin

Mac, Windows and Linux, yes

On Thu, 20 Jun 2024 at 03:02, Max Savin @.***> wrote:

@a4xrbj1 https://github.com/a4xrbj1 nice, and you are able to build a Mac app?

So far, I am able to run but not build

— Reply to this email directly, view it on GitHub https://github.com/Meteor-Community-Packages/meteor-desktop/issues/37#issuecomment-2179326192, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADHGCE6HS5KA523EHDXB7MDZIHIV7AVCNFSM6AAAAABBVXVRP6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZZGMZDMMJZGI . You are receiving this because you were mentioned.Message ID: @.***>

a4xrbj1 avatar Jun 19 '24 19:06 a4xrbj1

Oh wow, sounds too good to be true. Can you share your package.json and desktop settings file? Would really appreciate it as I haven’t been able to update this app in years

On Wed, Jun 19, 2024 at 3:59 PM Andreas West @.***> wrote:

Mac, Windows and Linux, yes

On Thu, 20 Jun 2024 at 03:02, Max Savin @.***> wrote:

@a4xrbj1 https://github.com/a4xrbj1 nice, and you are able to build a Mac app?

So far, I am able to run but not build

— Reply to this email directly, view it on GitHub < https://github.com/Meteor-Community-Packages/meteor-desktop/issues/37#issuecomment-2179326192>,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/ADHGCE6HS5KA523EHDXB7MDZIHIV7AVCNFSM6AAAAABBVXVRP6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZZGMZDMMJZGI>

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/Meteor-Community-Packages/meteor-desktop/issues/37#issuecomment-2179387642, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPP5A6AL4I3SMMCW5RFJ23ZIHPLHAVCNFSM6AAAAABBVXVRP6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNZZGM4DONRUGI . You are receiving this because you commented.Message ID: @.***>

msavin avatar Jun 19 '24 20:06 msavin

3.2 works fine for me with Meteor 2.16. I haven’t tested it on 3.0x RC? yet.

@a4xrbj1 are you sure 3.2 is working? I'm trying it with Meteor 2.1.6, and getting the api.caller() is not a function error.

I thought it was working to start with, but then I made a trivial change to my desktop.js file (triggering a change in the desktop hash and a re-build), then I get this error.

@iokill I've tried your 'dirty' fix from dupe #38 by using your branch meteor npm install -D https://github.com/innerspacetrainings/meteor-desktop#preset-env-hotfix and I still get the same error.

In the meantime, 3.1.1 appears to be be working for me so far...

wildhart avatar Aug 12 '24 22:08 wildhart

Why would I say it’s working when it’s not? Not sure why you question what I write but as I’ve written before, we’re using Meteor desktop since years and version 3.2 works fine, we distribute apps for all 3 OS to our users regularly.

On 13 Aug 2024, at 06:29, wildhart @.***> wrote:

3.2 works fine for me with Meteor 2.16. I haven’t tested it on 3.0x RC? yet.

@a4xrbj1 https://github.com/a4xrbj1 are you sure 3.2 is working? I'm trying it with Meteor 2.1.6, and getting the api.caller() is not a function error.

I thought it was working to start with, but then I made a trivial change to my desktop.js file (triggering a change in the desktop hash and a re-build), then I get this error.

@iokill https://github.com/iokill I've tried your 'dirty' fix from dupe #38 https://github.com/Meteor-Community-Packages/meteor-desktop/issues/38 by using your branch meteor npm install -D https://github.com/innerspacetrainings/meteor-desktop#preset-env-hotfix and I still get the same error.

In the meantime, 3.1.1 appears to be be working for me so far...

a4xrbj1 avatar Aug 13 '24 05:08 a4xrbj1

Why would I say it’s working when it’s not? Not sure why you question what I write.

The only reason I questioned it was because, as I wrote, it appeard to be working for me until I made a change to my desktop.js file causing it to be recompiled. Before that the cached desktop build was was working fine.

That's great that it's working for you, and sorry if you took offence at my questioning it.

Would you mind sharing your package.json and desktop settings? You appear to be the only person in this thread for whom it is working.

wildhart avatar Aug 13 '24 05:08 wildhart

package.json:

"dependencies": { @./client-s3": "3.565.0", @./client-sso-oidc": "3.565.0", @./client-sts": "3.565.0", @./runtime": "^7.25.0", @./browser-logs": "^5.23.3", @./ddp-graceful-shutdown": "^0.9.2", "animate.css": "^4.1.1", "bcrypt-nodejs": "0.0.3", "body-parser": "^1.20.2", "bootstrap": "^3.3.7", "bootstrap-tourist": "^0.3.2", "bowser": "^2.11.0", "clipboard": "^2.0.11", "crypto": "^1.0.1", "d3": "^7.9.0", "d3-cloud": "^1.2.7", "d3-hierarchy": "^3.1.2", "d3-request": "^1.0.6", "d3-selection-multi": "^1.0.1", "dayjs": "^1.11.12", "electron": "17.4.11", "electron-builder-squirrel-windows": "24.13.3", "electron-updater": "^6.2.1", "eslint-plugin-react-hooks": "^4.6.2", "fake-uagt": "^1.1.1", "font-awesome": "^4.7.0", "fs-js-lite": "^2.6.6", "jquery-bridget": "^3.0.1", "knox": "^0.9.2", "labelauty": "^1.1.3", "lazysizes": "^5.3.2", "leaflet": "^1.9.4", "leaflet.markercluster": "^1.5.3", "libnpx": "^10.2.4", "masonry-layout": "^4.2.2", "meteor-node-stubs": "^1.2.9", "ngraph.graph": "^20.0.1", "ngraph.svg": "^0.0.17", "owl.carousel": "^2.3.4", "popper.js": "^1.16.1", "qs": "^6.13.0", "request": "^2.88.2", "toastr": "^2.1.4", "underscore": "^1.13.7", "update-notifier": "^6.0.2", "velocity-animate": "^1.5.2", "velocity-ui-pack": "^1.2.2" }, "devDependencies": { @./core": "^7.25.2", @./eslint-parser": "^7.25.1", @./notarize": "^2.3.2", @./osx-sign": "^1.3.1", @.***/meteor-desktop": "3.2.0", "electron-builder": "^24.13.3", "electron-packager": "^17.1.2", "electron-rebuild": "^3.2.9", "eslint": "^8.57.0", "eslint-config-airbnb": "^19.0.4", "eslint-import-resolver-meteor": "^0.4.0", "eslint-plugin-import": "^2.29.1", "eslint-plugin-jsx-a11y": "^6.9.0", "eslint-plugin-meteor": "^7.3.0", "eslint-plugin-react": "^7.35.0", "nock": "^13.5.4" } Our desktop.js has a lot of app specific code and I don’t think it’s relevant for your problem. Check which versions we’re using in regards to Babel, that will be most likely the area where the difference lies.

In regards to questioning, if something doesn’t work for you but someone else writes that it works for them, you should question your own code base, not what the other person is stating.

On 13 Aug 2024, at 13:25, wildhart @.***> wrote:

Why would I say it’s working when it’s not? Not sure why you question what I write.

The only reason I questioned it was because, as I wrote, it appeard to be working for me until I made a change to my desktop.js file causing it to be recompiled. Before that the cached desktop build was was working fine.

That's great that it's working for you, and sorry if you took offence at my questioning it.

Would you mind sharing your package.json and desktop settings? You appear to be the only person in this thread for whom it is working.

— Reply to this email directly, view it on GitHub https://github.com/Meteor-Community-Packages/meteor-desktop/issues/37#issuecomment-2285364089, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADHGCEZKUHAVDCY6X35F2TLZRGKGNAVCNFSM6AAAAABBVXVRP6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBVGM3DIMBYHE. You are receiving this because you were mentioned.

a4xrbj1 avatar Aug 13 '24 06:08 a4xrbj1